Skip to content

Commit 272dae2

Browse files
committed
don't reorder custom tools in modal based on edit time
1 parent 6a785b9 commit 272dae2

File tree

1 file changed

+3
-1
lines changed

1 file changed

+3
-1
lines changed

apps/sim/app/api/tools/custom/route.ts

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
import { db } from '@sim/db'
22
import { customTools, workflow } from '@sim/db/schema'
3-
import { and, eq, isNull, ne, or } from 'drizzle-orm'
3+
import { and, desc, eq, isNull, ne, or } from 'drizzle-orm'
44
import { type NextRequest, NextResponse } from 'next/server'
55
import { z } from 'zod'
66
import { checkHybridAuth } from '@/lib/auth/hybrid'
@@ -101,6 +101,7 @@ export async function GET(request: NextRequest) {
101101
.select()
102102
.from(customTools)
103103
.where(or(...conditions))
104+
.orderBy(desc(customTools.createdAt))
104105

105106
return NextResponse.json({ data: result }, { status: 200 })
106107
} catch (error) {
@@ -266,6 +267,7 @@ export async function POST(req: NextRequest) {
266267
.select()
267268
.from(customTools)
268269
.where(eq(customTools.workspaceId, workspaceId))
270+
.orderBy(desc(customTools.createdAt))
269271

270272
return NextResponse.json({ success: true, data: resultTools })
271273
})

0 commit comments

Comments
 (0)