We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 9c4ee35 commit 0136815Copy full SHA for 0136815
src/api/services/channel.service.ts
@@ -335,7 +335,10 @@ export class ChannelStartupService {
335
};
336
337
if (query.offset) contactFindManyArgs.take = query.offset;
338
- if (query.page) contactFindManyArgs.skip = query.offset * ((query.page as number) - 1);
+ if (query.page) {
339
+ const validPage = Math.max(query.page as number, 1);
340
+ contactFindManyArgs.skip = query.offset * (validPage - 1);
341
+ }
342
343
return await this.prismaRepository.contact.findMany(contactFindManyArgs);
344
}
0 commit comments