From ef9fdb93d2999e98ea0ecb750ba0f0409793f166 Mon Sep 17 00:00:00 2001 From: Johann150 Date: Tue, 5 Jul 2022 10:42:54 +0200 Subject: [PATCH] fix: pagination uses API correctly (#8925) --- packages/client/src/components/ui/pagination.vue | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/packages/client/src/components/ui/pagination.vue b/packages/client/src/components/ui/pagination.vue index c081e06acd..a03c2b3a1d 100644 --- a/packages/client/src/components/ui/pagination.vue +++ b/packages/client/src/components/ui/pagination.vue @@ -133,8 +133,10 @@ const fetchMore = async (): Promise => { limit: SECOND_FETCH_LIMIT + 1, ...(props.pagination.offsetMode ? { offset: offset.value, + } : props.pagination.reversed ? { + sinceId: items.value[0].id, } : { - untilId: props.pagination.reversed ? items.value[0].id : items.value[items.value.length - 1].id, + untilId: items.value[items.value.length - 1].id, }), }).then(res => { for (let i = 0; i < res.length; i++) { @@ -169,8 +171,10 @@ const fetchMoreAhead = async (): Promise => { limit: SECOND_FETCH_LIMIT + 1, ...(props.pagination.offsetMode ? { offset: offset.value, + } : props.pagination.reversed ? { + untilId: items.value[0].id, } : { - sinceId: props.pagination.reversed ? items.value[0].id : items.value[items.value.length - 1].id, + sinceId: items.value[items.value.length - 1].id, }), }).then(res => { if (res.length > SECOND_FETCH_LIMIT) {