File tree Expand file tree Collapse file tree 3 files changed +12
-3
lines changed Expand file tree Collapse file tree 3 files changed +12
-3
lines changed Original file line number Diff line number Diff line change @@ -168,7 +168,7 @@ export default Vue.extend({
168
168
mounted () {
169
169
// Lists is required across different views. On app load, fetch the lists
170
170
// and have them in the store.
171
- this .$api .getLists ({ minimal: true });
171
+ this .$api .getLists ({ minimal: true , per_page : ' all ' });
172
172
173
173
window .addEventListener (' resize' , () => {
174
174
this .windowWidth = window .innerWidth ;
Original file line number Diff line number Diff line change @@ -115,6 +115,12 @@ export const getLists = (params) => http.get('/api/lists',
115
115
store : models . lists ,
116
116
} ) ;
117
117
118
+ export const queryLists = ( params ) => http . get ( '/api/lists' ,
119
+ {
120
+ params : ( ! params ? { per_page : 'all' } : params ) ,
121
+ loading : models . lists ,
122
+ } ) ;
123
+
118
124
export const getList = async ( id ) => http . get ( `/api/lists/${ id } ` ,
119
125
{ loading : models . list } ) ;
120
126
Original file line number Diff line number Diff line change @@ -173,6 +173,7 @@ export default Vue.extend({
173
173
curItem: null ,
174
174
isEditing: false ,
175
175
isFormVisible: false ,
176
+ lists: [],
176
177
queryParams: {
177
178
page: 1 ,
178
179
query: ' ' ,
@@ -228,11 +229,13 @@ export default Vue.extend({
228
229
},
229
230
230
231
getLists () {
231
- this .$api .getLists ({
232
+ this .$api .queryLists ({
232
233
page: this .queryParams .page ,
233
234
query: this .queryParams .query ,
234
235
order_by: this .queryParams .orderBy ,
235
236
order: this .queryParams .order ,
237
+ }).then ((resp ) => {
238
+ this .lists = resp;
236
239
});
237
240
},
238
241
@@ -268,7 +271,7 @@ export default Vue.extend({
268
271
},
269
272
270
273
computed: {
271
- ... mapState ([' loading' , ' lists ' , ' settings' ]),
274
+ ... mapState ([' loading' , ' settings' ]),
272
275
},
273
276
274
277
mounted () {
You can’t perform that action at this time.
0 commit comments