|
|
@@ -199,22 +199,13 @@ export default {
|
|
199
|
199
|
post => post.slug == this.$route.params.slug,
|
|
200
|
200
|
)[0]
|
|
201
|
201
|
|
|
202
|
|
- // Look if it exists before you try and load everything!
|
|
203
|
|
- // if(!singlePostData) {
|
|
204
|
|
- // const res = await this.$store.dispatch(`getAll${convertTitleCase(this.type)}s`, { sortType: null, params: null})
|
|
205
|
|
- // allPostsOfType = res
|
|
206
|
|
- // singlePostData = allPostsOfType.filter(
|
|
207
|
|
- // post => post.slug == this.$route.params.slug,
|
|
208
|
|
- // )[0]
|
|
209
|
|
- // }
|
|
210
|
|
-
|
|
211
|
202
|
if (!singlePostData) return console.error('could not get single post data...')
|
|
212
|
203
|
|
|
213
|
204
|
// NOT plural
|
|
214
|
205
|
this.checkAndSetHero(singlePostData)
|
|
215
|
206
|
await this.$store.dispatch(
|
|
216
|
207
|
`getSingle${convertTitleCase(this.type)}`,
|
|
217
|
|
- singlePostData.id,
|
|
|
208
|
+ this.id,
|
|
218
|
209
|
)
|
|
219
|
210
|
this.loading = false
|
|
220
|
211
|
},
|