From 6497933c3e200c233d0d2bf16b1abed44baedbf8 Mon Sep 17 00:00:00 2001 From: BOHA Date: Tue, 24 Mar 2026 18:56:42 +0100 Subject: [PATCH] =?UTF-8?q?fix:=20keep=20lock=20after=20save=20=E2=80=94?= =?UTF-8?q?=20user=20stays=20on=20the=20page?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/routes/admin/quotations.ts | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/src/routes/admin/quotations.ts b/src/routes/admin/quotations.ts index 3b614a8..573a84f 100644 --- a/src/routes/admin/quotations.ts +++ b/src/routes/admin/quotations.ts @@ -172,8 +172,7 @@ export default async function quotationsRoutes(fastify: FastifyInstance): Promis if (result.error === 'invalidated') return error(reply, 'Nelze upravit zneplatněnou nabídku', 400); } - // Release lock after save - await prisma.quotations.updateMany({ where: { id, locked_by: request.authData!.userId }, data: { locked_by: null, locked_at: null } }); + // Keep lock — user stays on the page after save await logAudit({ request, authData: request.authData, action: 'update', entityType: 'quotation', entityId: id, description: `Upravena nabídka ${(result as any).quotation_number}` }); return success(reply, { id }, 200, 'Nabídka byla uložena');