From 4a7cd41a908cb5d970a8f47e8c27a507f7acd22b Mon Sep 17 00:00:00 2001 From: Natty Date: Mon, 1 Jan 2024 20:57:26 +0100 Subject: [PATCH] Fixed pagination if no params are set --- packages/backend/src/server/api/common/make-pagination-query.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/packages/backend/src/server/api/common/make-pagination-query.ts b/packages/backend/src/server/api/common/make-pagination-query.ts index 73b32b9a52..fca8299f3b 100644 --- a/packages/backend/src/server/api/common/make-pagination-query.ts +++ b/packages/backend/src/server/api/common/make-pagination-query.ts @@ -7,7 +7,7 @@ export function makePaginationQuery( sinceDate?: number, untilDate?: number, ) { - if (!sinceDate && !untilDate) { + if (!sinceDate && !untilDate && (sinceId || untilId)) { if (sinceId && untilId) { q.andWhere(`${q.alias}.id > :sinceId`, { sinceId: sinceId }); q.andWhere(`${q.alias}.id < :untilId`, { untilId: untilId });