From b687e6886cb68d5dbc4f94f08cf024a138883b97 Mon Sep 17 00:00:00 2001 From: Eliot Berriot Date: Tue, 3 Mar 2020 13:33:04 +0100 Subject: [PATCH] Fixed broken pagination on favorites --- front/src/components/favorites/List.vue | 8 ++------ front/src/store/ui.js | 5 +++++ 2 files changed, 7 insertions(+), 6 deletions(-) diff --git a/front/src/components/favorites/List.vue b/front/src/components/favorites/List.vue index ef64f9bac..003f293b5 100644 --- a/front/src/components/favorites/List.vue +++ b/front/src/components/favorites/List.vue @@ -92,18 +92,12 @@ export default { Pagination }, data() { - let defaultOrdering = this.getOrderingFromString( - this.defaultOrdering || "-creation_date" - ) return { results: null, isLoading: false, nextLink: null, previousLink: null, page: parseInt(this.defaultPage), - paginateBy: parseInt(this.defaultPaginateBy || 25), - orderingDirection: defaultOrdering.direction || "+", - ordering: defaultOrdering.field, orderingOptions: [ ["creation_date", "creation_date"], ["title", "track_title"], @@ -117,6 +111,7 @@ export default { this.$router.push({name: 'login', query: {next: this.$router.currentRoute.fullPath}}) } this.fetchFavorites(FAVORITES_URL) + }, mounted() { $(".ui.dropdown").dropdown() @@ -140,6 +135,7 @@ export default { ordering: this.getOrderingAsString() } }) + this.fetchFavorites(FAVORITES_URL) }, fetchFavorites(url) { var self = this diff --git a/front/src/store/ui.js b/front/src/store/ui.js index 3e481917a..e2ca0e636 100644 --- a/front/src/store/ui.js +++ b/front/src/store/ui.js @@ -87,6 +87,11 @@ export default { orderingDirection: "-", ordering: "creation_date", }, + "favorites": { + paginateBy: 50, + orderingDirection: "-", + ordering: "creation_date", + }, }, serviceWorker: { refreshing: false,