Skip to content

High performance, self-hosted, newsletter and mailing list manager with a modern dashboard. Single binary app.

Fix lists UI queries overriding full lists in selections elsewhere. Closes #1400.

Kailash Nadh0be5901df7be
diff --git a/frontend/src/App.vue b/frontend/src/App.vue
index 418f2978..693da05a 100644
--- a/frontend/src/App.vue
+++ b/frontend/src/App.vue
@@ -168,7 +168,7 @@ export default Vue.extend({
mounted() {
// Lists is required across different views. On app load, fetch the lists
// and have them in the store.
- this.$api.getLists({ minimal: true });
+ this.$api.getLists({ minimal: true, per_page: 'all' });
window.addEventListener('resize', () => {
this.windowWidth = window.innerWidth;
diff --git a/frontend/src/api/index.js b/frontend/src/api/index.js
index c37a32f1..eedee90b 100644
--- a/frontend/src/api/index.js
+++ b/frontend/src/api/index.js
@@ -115,6 +115,12 @@ export const getLists = (params) => http.get('/api/lists',
store: models.lists,
});
+export const queryLists = (params) => http.get('/api/lists',
+ {
+ params: (!params ? { per_page: 'all' } : params),
+ loading: models.lists,
+ });
+
export const getList = async (id) => http.get(`/api/lists/${id}`,
{ loading: models.list });
diff --git a/frontend/src/views/Lists.vue b/frontend/src/views/Lists.vue
index c26b0fd0..8bce9548 100644
--- a/frontend/src/views/Lists.vue
+++ b/frontend/src/views/Lists.vue
@@ -173,6 +173,7 @@ export default Vue.extend({
curItem: null,
isEditing: false,
isFormVisible: false,
+ lists: [],
queryParams: {
page: 1,
query: '',
@@ -228,11 +229,13 @@ export default Vue.extend({
},
getLists() {
- this.$api.getLists({
+ this.$api.queryLists({
page: this.queryParams.page,
query: this.queryParams.query,
order_by: this.queryParams.orderBy,
order: this.queryParams.order,
+ }).then((resp) => {
+ this.lists = resp;
});
},
@@ -268,7 +271,7 @@ export default Vue.extend({
},
computed: {
- ...mapState(['loading', 'lists', 'settings']),
+ ...mapState(['loading', 'settings']),
},
mounted() {