fix: keep lock after save — user stays on the page

This commit is contained in:
BOHA
2026-03-24 18:56:42 +01:00
parent 1addd22a24
commit 6497933c3e

View File

@@ -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');