Browse Source

:bug: fixing links in list page to use post type

tags/1.0.0
J 4 years ago
parent
commit
b6a8fd6713

+ 2
- 2
vue-theme/src/pages/list.vue View File

@@ -18,7 +18,7 @@
18 18
         ul.posts.f-col(v-if="posts && loaded" :class="{ 'is-grid': grid }")
19 19
             template(v-for="(post, i) in posts" :key="post.slug")
20 20
                 li.post.shadow(v-if="!post.inbetween" )
21
-                    card(:content="post" :type="type" :wide="isWide")
21
+                    card(:content="post" :type="post.type" :wide="isWide")
22 22
                 li.post.shadow.inbetween.t-up.f-row.w-max(v-else-if="post.inbetween" :id="post.slug")
23 23
                     p {{ post.slug }}
24 24
             
@@ -67,7 +67,7 @@ export default {
67 67
             return gridTypes.includes(this.type)
68 68
         },
69 69
         isSearch() {
70
-            return this.$route.path == '/search'
70
+            return this.searchTerm
71 71
         },
72 72
         isWide() {
73 73
             return wideTypes.includes(this.type)

+ 2
- 2
vue-theme/src/store/modules/post.js View File

@@ -30,7 +30,7 @@ const _arrangeByType = postsList => {
30 30
 }
31 31
 
32 32
 const actions = {
33
-    getAllPosts({ commit }, { sortType, params }) {
33
+    async getAllPosts({ commit }, { sortType, params }) {
34 34
         commit('CLEAR_POSTS')
35 35
         commit('POSTS_LOADED', false)
36 36
         const storeFetch = (posts => {
@@ -41,7 +41,7 @@ const actions = {
41 41
             commit('STORE_FETCHED_POSTS', { posts: repacked })
42 42
             commit('POSTS_LOADED', true)
43 43
         }) 
44
-        return api.getByType({ type: 'post', sort: sortType, params, cb: storeFetch })
44
+        return await api.getByType({ type: 'post', sort: sortType, params, cb: storeFetch })
45 45
     },
46 46
     getMorePosts({ commit }, { sortType, params }) {
47 47
         const storeFetch = (posts => {

+ 0
- 1
vue-theme/src/store/modules/search.js View File

@@ -22,7 +22,6 @@ const actions = {
22 22
 
23 23
 const mutations = {
24 24
     ADD_TO_FETCHED_SEARCH_RESULTS(state, { searchResults }) {
25
-        console.log('adding results', searchResults)
26 25
         state.all = [...state.all, ...searchResults]
27 26
     },
28 27
     STORE_FETCHED_SEARCH_RESULTS(state, { searchResults }) {

Loading…
Cancel
Save