fix: remove as-any casts, type Dashboard data properly

- Route handlers: add exhaustive return after error checks so TypeScript
  narrows the union and result properties are accessible without casts
- attendance.service: use Prisma.attendanceGetPayload for included relations
- projects.service: remove unnecessary cast on orders relation
- Dashboard.tsx: replace Record<string,any> with proper DashData interface

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
This commit is contained in:
BOHA
2026-03-24 20:20:43 +01:00
parent 106606f3fa
commit 87dbde5c59
6 changed files with 74 additions and 17 deletions

View File

@@ -278,6 +278,7 @@ export default async function quotationsRoutes(
return error(reply, "Nabídka nenalezena", 404);
if (result.error === "invalidated")
return error(reply, "Nelze upravit zneplatněnou nabídku", 400);
return error(reply, "Neznámá chyba", 500);
}
// Keep lock — user stays on the page after save
@@ -288,7 +289,7 @@ export default async function quotationsRoutes(
action: "update",
entityType: "quotation",
entityId: id,
description: `Upravena nabídka ${(result as any).quotation_number}`,
description: `Upravena nabídka ${result.quotation_number}`,
});
return success(reply, { id }, 200, "Nabídka byla uložena");
},