Skip to content

Commit 0be5901

Browse files
committed
Fix lists UI queries overriding full lists in selections elsewhere. Closes #1400.
1 parent 534c875 commit 0be5901

File tree

3 files changed

+12
-3
lines changed

3 files changed

+12
-3
lines changed

frontend/src/App.vue

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -168,7 +168,7 @@ export default Vue.extend({
168168
mounted() {
169169
// Lists is required across different views. On app load, fetch the lists
170170
// and have them in the store.
171-
this.$api.getLists({ minimal: true });
171+
this.$api.getLists({ minimal: true, per_page: 'all' });
172172
173173
window.addEventListener('resize', () => {
174174
this.windowWidth = window.innerWidth;

frontend/src/api/index.js

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -115,6 +115,12 @@ export const getLists = (params) => http.get('/api/lists',
115115
store: models.lists,
116116
});
117117

118+
export const queryLists = (params) => http.get('/api/lists',
119+
{
120+
params: (!params ? { per_page: 'all' } : params),
121+
loading: models.lists,
122+
});
123+
118124
export const getList = async (id) => http.get(`/api/lists/${id}`,
119125
{ loading: models.list });
120126

frontend/src/views/Lists.vue

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -173,6 +173,7 @@ export default Vue.extend({
173173
curItem: null,
174174
isEditing: false,
175175
isFormVisible: false,
176+
lists: [],
176177
queryParams: {
177178
page: 1,
178179
query: '',
@@ -228,11 +229,13 @@ export default Vue.extend({
228229
},
229230
230231
getLists() {
231-
this.$api.getLists({
232+
this.$api.queryLists({
232233
page: this.queryParams.page,
233234
query: this.queryParams.query,
234235
order_by: this.queryParams.orderBy,
235236
order: this.queryParams.order,
237+
}).then((resp) => {
238+
this.lists = resp;
236239
});
237240
},
238241
@@ -268,7 +271,7 @@ export default Vue.extend({
268271
},
269272
270273
computed: {
271-
...mapState(['loading', 'lists', 'settings']),
274+
...mapState(['loading', 'settings']),
272275
},
273276
274277
mounted() {

0 commit comments

Comments
 (0)