mirror of
https://github.com/fosrl/pangolin.git
synced 2026-03-03 09:16:40 +00:00
♻️ sort by pending first
This commit is contained in:
@@ -68,7 +68,10 @@ async function queryApprovals(orgId: string, limit: number, offset: number) {
|
|||||||
)
|
)
|
||||||
)
|
)
|
||||||
.where(eq(approvals.orgId, orgId))
|
.where(eq(approvals.orgId, orgId))
|
||||||
.orderBy(desc(approvals.timestamp))
|
.orderBy(
|
||||||
|
sql`CASE ${approvals.decision} WHEN 'pending' THEN 0 ELSE 1 END`,
|
||||||
|
desc(approvals.timestamp)
|
||||||
|
)
|
||||||
.limit(limit)
|
.limit(limit)
|
||||||
.offset(offset);
|
.offset(offset);
|
||||||
return res;
|
return res;
|
||||||
|
|||||||
Reference in New Issue
Block a user