mirror of
https://github.com/zoriya/Kyoo.git
synced 2025-07-09 03:04:20 -04:00
Sort nulls at the end even in desc order
This commit is contained in:
parent
c71650d386
commit
3547799079
@ -177,7 +177,7 @@ export const movies = new Elysia({ prefix: "/movies", tags: ["movies"] })
|
|||||||
.innerJoin(transQ, eq(shows.pk, transQ.pk))
|
.innerJoin(transQ, eq(shows.pk, transQ.pk))
|
||||||
.where(and(filter, keysetPaginate({ table: shows, after, sort })))
|
.where(and(filter, keysetPaginate({ table: shows, after, sort })))
|
||||||
.orderBy(
|
.orderBy(
|
||||||
...sort.map((x) => (x.desc ? desc(shows[x.key]) : shows[x.key])),
|
...sort.map((x) => (x.desc ? sql`${shows[x.key]} desc nulls last` : shows[x.key])),
|
||||||
shows.pk,
|
shows.pk,
|
||||||
)
|
)
|
||||||
.limit(limit);
|
.limit(limit);
|
||||||
|
Loading…
x
Reference in New Issue
Block a user