Ver código fonte

:poop: ternary attempt two

tags/0.9.0
J 4 anos atrás
pai
commit
cec99b3a4b
1 arquivos alterados com 6 adições e 7 exclusões
  1. 6
    7
      vue-theme/src/pages/list.vue

+ 6
- 7
vue-theme/src/pages/list.vue Ver arquivo

@@ -72,11 +72,6 @@ export default {
72 72
             this.getPosts(false)
73 73
         },
74 74
         async getPosts(clear) {
75
-            // Limit
76
-            let params = {
77
-                limit: this.perPage,
78
-                page: this.page
79
-            }
80 75
             // Sorting
81 76
             let sort = this.sortBy
82 77
                 ? this.sortBy
@@ -87,13 +82,17 @@ export default {
87 82
 
88 83
             let dispatchParams = {
89 84
                 sortType: ['event', 'exhibition'].includes(this.type) ? sortTypes.currentAndUpcoming : sort,
90
-                params
85
+                params: {
86
+                    limit: this.perPage,
87
+                    page: this.page
88
+                }
91 89
             }
90
+
92 91
             let dispatchAction = clear ? `getAll${this.pType}` : `getMore${this.pType}`
93 92
 
94 93
             const res = await this.$store.dispatch(dispatchAction, dispatchParams)
95 94
 
96
-            if(!res?.length) {
95
+            if(res && res.length < 0) {
97 96
                 console.warn('nothing left to get...')
98 97
                 console.log('responded:', res)
99 98
             }

Carregando…
Cancelar
Salvar