|
|
@@ -203,12 +203,15 @@ export default {
|
|
203
|
203
|
/**
|
|
204
|
204
|
* Load posts if they're not already in state
|
|
205
|
205
|
*/
|
|
|
206
|
+ // Find the single post from api if it's not already in state
|
|
|
207
|
+ // Then add it to our list
|
|
|
208
|
+
|
|
206
|
209
|
// if (!this[`all${type}Loaded`] && allPostsOfType.length < 1) {
|
|
207
|
|
- const res = await this.$store.dispatch(`getAll${type}`)
|
|
208
|
|
- allPostsOfType = res
|
|
209
|
|
- console.log(`reloaded ${type}...`)
|
|
|
210
|
+ const res = await this.$store.dispatch(`getAll${type}`, { sortType: null, params: null})
|
|
|
211
|
+ allPostsOfType = res
|
|
|
212
|
+ console.log(`reloaded ${type}...`)
|
|
210
|
213
|
// }
|
|
211
|
|
- if (allPostsOfType.length < 1) return
|
|
|
214
|
+
|
|
212
|
215
|
const singlePostData = allPostsOfType.filter(
|
|
213
|
216
|
post => post.slug == this.$route.params.slug,
|
|
214
|
217
|
)[0]
|