diff --git a/src/views/Event/ParticipantsView.vue b/src/views/Event/ParticipantsView.vue
index 91a593eaa..847d44f99 100644
--- a/src/views/Event/ParticipantsView.vue
+++ b/src/views/Event/ParticipantsView.vue
@@ -39,7 +39,7 @@
-
+
(page = newPage)"
+ @page-change="onPageChange"
@sort="(field: string, order: string) => emit('sort', field, order)"
>
([]);
const queueTable = ref();
-const { result: participantsResult, loading: participantsLoading } = useQuery<{
+const {
+ result: participantsResult,
+ loading: participantsLoading,
+ refetch: participantsRefetch,
+} = useQuery<{
event: IEvent;
}>(
PARTICIPANTS,
@@ -338,6 +342,18 @@ const { result: participantsResult, loading: participantsLoading } = useQuery<{
})
);
+const onPageChange = (p: number): void => {
+ // Change is not instantaneous since page is created with useRouteQuery linked to the URL state
+ page.value = p;
+ participantsRefetch({
+ uuid: eventId.value,
+ // use p to send the new value, not page.value (contains the old value)
+ page: p,
+ limit: PARTICIPANTS_PER_PAGE,
+ roles: role.value === "EVERYTHING" ? undefined : role.value,
+ });
+};
+
const event = computed(() => participantsResult.value?.event);
// const participantStats = computed((): IEventParticipantStats | null => {