Fixed pagination if no params are set
ci/woodpecker/tag/ociImageTag Pipeline was successful Details

This commit is contained in:
Natty 2024-01-01 20:57:26 +01:00
parent e046598329
commit 4a7cd41a90
Signed by: natty
GPG Key ID: BF6CB659ADEE60EC
1 changed files with 1 additions and 1 deletions

View File

@ -7,7 +7,7 @@ export function makePaginationQuery<T>(
sinceDate?: number, sinceDate?: number,
untilDate?: number, untilDate?: number,
) { ) {
if (!sinceDate && !untilDate) { if (!sinceDate && !untilDate && (sinceId || untilId)) {
if (sinceId && untilId) { if (sinceId && untilId) {
q.andWhere(`${q.alias}.id > :sinceId`, { sinceId: sinceId }); q.andWhere(`${q.alias}.id > :sinceId`, { sinceId: sinceId });
q.andWhere(`${q.alias}.id < :untilId`, { untilId: untilId }); q.andWhere(`${q.alias}.id < :untilId`, { untilId: untilId });