Преглед изворни кода

:bug: adding missing destructured params with getAll req

tags/0.9.0
J пре 4 година
родитељ
комит
a6a481ed5e
1 измењених фајлова са 7 додато и 4 уклоњено
  1. 7
    4
      vue-theme/src/pages/single.vue

+ 7
- 4
vue-theme/src/pages/single.vue Прегледај датотеку

@@ -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]

Loading…
Откажи
Сачувај