mirror of
https://github.com/simstudioai/sim.git
synced 2026-01-08 22:48:14 -05:00
fix(templates): only change updatedAt for actual updates to workflow or metadata (#2630)
This commit is contained in:
committed by
GitHub
parent
da1f668272
commit
400178a3b0
@@ -70,7 +70,6 @@ export async function GET(request: NextRequest, { params }: { params: Promise<{
|
|||||||
.update(templates)
|
.update(templates)
|
||||||
.set({
|
.set({
|
||||||
views: sql`${templates.views} + 1`,
|
views: sql`${templates.views} + 1`,
|
||||||
updatedAt: new Date(),
|
|
||||||
})
|
})
|
||||||
.where(eq(templates.id, id))
|
.where(eq(templates.id, id))
|
||||||
|
|
||||||
|
|||||||
@@ -100,7 +100,6 @@ export async function POST(request: NextRequest, { params }: { params: Promise<{
|
|||||||
.update(templates)
|
.update(templates)
|
||||||
.set({
|
.set({
|
||||||
stars: sql`${templates.stars} + 1`,
|
stars: sql`${templates.stars} + 1`,
|
||||||
updatedAt: new Date(),
|
|
||||||
})
|
})
|
||||||
.where(eq(templates.id, id))
|
.where(eq(templates.id, id))
|
||||||
})
|
})
|
||||||
@@ -160,7 +159,6 @@ export async function DELETE(
|
|||||||
.update(templates)
|
.update(templates)
|
||||||
.set({
|
.set({
|
||||||
stars: sql`GREATEST(${templates.stars} - 1, 0)`,
|
stars: sql`GREATEST(${templates.stars} - 1, 0)`,
|
||||||
updatedAt: new Date(),
|
|
||||||
})
|
})
|
||||||
.where(eq(templates.id, id))
|
.where(eq(templates.id, id))
|
||||||
})
|
})
|
||||||
|
|||||||
@@ -136,7 +136,6 @@ export async function POST(request: NextRequest, { params }: { params: Promise<{
|
|||||||
// Prepare template update data
|
// Prepare template update data
|
||||||
const updateData: any = {
|
const updateData: any = {
|
||||||
views: sql`${templates.views} + 1`,
|
views: sql`${templates.views} + 1`,
|
||||||
updatedAt: now,
|
|
||||||
}
|
}
|
||||||
|
|
||||||
// If connecting to template for editing, also update the workflowId
|
// If connecting to template for editing, also update the workflowId
|
||||||
|
|||||||
Reference in New Issue
Block a user