Преглед на файлове

:poop: ternary attempt two

tags/0.9.0
J преди 4 години
родител
ревизия
cec99b3a4b
променени са 1 файла, в които са добавени 6 реда и са изтрити 7 реда
  1. 6
    7
      vue-theme/src/pages/list.vue

+ 6
- 7
vue-theme/src/pages/list.vue Целия файл

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

Loading…
Отказ
Запис