From 34fe0dc034a4a32a1e728995396ff7c66ff8eeff Mon Sep 17 00:00:00 2001 From: Omer Sabic Date: Fri, 7 Jun 2024 22:00:08 +0200 Subject: [PATCH] fix --- src/routes/dashboard.js | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/src/routes/dashboard.js b/src/routes/dashboard.js index 9d71775..5c1c6a4 100644 --- a/src/routes/dashboard.js +++ b/src/routes/dashboard.js @@ -354,8 +354,10 @@ export const dashboardRoutes = (fastify, _, done) => { }); } - req.body.id = undefined; - await db.update(sites).set(req.body); + const data = structuredClone(req.body.id); + + delete data.id; + await db.update(sites).set(data).where(eq(sites.id, req.body.id)); return { success: true