From 16c4d8313e65e8c85ee79e9cd2d469c9b349c288 Mon Sep 17 00:00:00 2001 From: manelcecs Date: Thu, 22 Feb 2024 13:08:23 +0100 Subject: [PATCH] Fix how prevPageCursor is computed --- src/domain-services/flows/flow-search-service.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/domain-services/flows/flow-search-service.ts b/src/domain-services/flows/flow-search-service.ts index 9fb870a8..dfb007e8 100644 --- a/src/domain-services/flows/flow-search-service.ts +++ b/src/domain-services/flows/flow-search-service.ts @@ -271,7 +271,7 @@ export class FlowSearchService { flows: items, hasNextPage: limit <= flows.length, hasPreviousPage: nextPageCursor !== undefined, - prevPageCursor: nextPageCursor ?? 0, + prevPageCursor: nextPageCursor ? nextPageCursor - limit : 0, nextPageCursor: nextPageCursor ? nextPageCursor + limit : limit, pageSize: flows.length, sortField: `${orderBy.entity}.${orderBy.column}` as FlowSortField,