Skip to content

Commit

Permalink
Merge remote-tracking branch 'origin/dev' into dev
Browse files Browse the repository at this point in the history
  • Loading branch information
mikecao committed Sep 29, 2023
2 parents 9a52cdd + 49ad536 commit 0f12226
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions src/lib/prisma.ts
Original file line number Diff line number Diff line change
Expand Up @@ -185,15 +185,15 @@ function getPageFilters(filters: SearchFilter): [
orderBy: string;
},
] {
const { page = 1, pageSize = DEFAULT_PAGE_SIZE, orderBy } = filters || {};
const { page = 1, pageSize = DEFAULT_PAGE_SIZE, orderBy, sortDescending = false } = filters || {};

return [
{
...(pageSize > 0 && { take: pageSize, skip: pageSize * (page - 1) }),
...(orderBy && {
orderBy: [
{
[orderBy]: 'asc',
[orderBy]: sortDescending ? 'desc' : 'asc',
},
],
}),
Expand Down

0 comments on commit 0f12226

Please sign in to comment.