From baa8582df72f8e3b9f0a506ffbeb66105cde8fc7 Mon Sep 17 00:00:00 2001 From: Thomas Citharel <tcit@tcit.fr> Date: Wed, 24 Nov 2021 16:05:52 +0100 Subject: [PATCH] Fix event participants pagination Signed-off-by: Thomas Citharel <tcit@tcit.fr> --- js/src/views/Event/Participants.vue | 15 +++------------ 1 file changed, 3 insertions(+), 12 deletions(-) diff --git a/js/src/views/Event/Participants.vue b/js/src/views/Event/Participants.vue index b90a09872..247f7fa71 100644 --- a/js/src/views/Event/Participants.vue +++ b/js/src/views/Event/Participants.vue @@ -90,6 +90,7 @@ :show-detail-icon="false" :loading="this.$apollo.loading" paginated + :current-page="page" backend-pagination :pagination-simple="true" :aria-next-label="$t('Next page')" @@ -259,7 +260,7 @@ </template> <script lang="ts"> -import { Component, Prop, Vue, Watch, Ref } from "vue-property-decorator"; +import { Component, Prop, Vue, Ref } from "vue-property-decorator"; import { ParticipantRole } from "@/types/enums"; import { IParticipant } from "../../types/participant.model"; import { IEvent, IEventParticipantStats } from "../../types/event.model"; @@ -369,17 +370,6 @@ export default class Participants extends Vue { return this.event.participantStats; } - @Watch("page") - loadMoreParticipants(): void { - this.$apollo.queries.event.fetchMore({ - // New variables - variables: { - page: this.page, - limit: this.limit, - }, - }); - } - async acceptParticipant(participant: IParticipant): Promise<void> { try { await this.$apollo.mutate({ @@ -521,6 +511,7 @@ export default class Participants extends Vue { name: routeName, query: { ...this.$route.query, ...args }, }); + this.$apollo.queries.event.refetch(); } catch (e) { if (isNavigationFailure(e, NavigationFailureType.redirected)) { throw Error(e.toString());