Fix event participants pagination

Signed-off-by: Thomas Citharel <tcit@tcit.fr>
This commit is contained in:
Thomas Citharel 2021-11-24 16:05:52 +01:00
parent ef954569f4
commit baa8582df7
No known key found for this signature in database
GPG Key ID: A061B9DDE0CA0773

View File

@ -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());