mirror of
https://github.com/fosrl/pangolin.git
synced 2026-01-28 22:00:51 +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))
|
||||
.orderBy(desc(approvals.timestamp))
|
||||
.orderBy(
|
||||
sql`CASE ${approvals.decision} WHEN 'pending' THEN 0 ELSE 1 END`,
|
||||
desc(approvals.timestamp)
|
||||
)
|
||||
.limit(limit)
|
||||
.offset(offset);
|
||||
return res;
|
||||
|
||||
Reference in New Issue
Block a user