chore: fix typecheck on monorepo
- regeneratePlan: switch return type to Promise<void> so it satisfies the React form action contract. - fast.routes PATCH: omit undefined keys instead of passing them, to comply with Prisma + exactOptionalPropertyTypes. - weight-entry-form: cast field value/defaultValues to bypass z.input reporting `Date` for `z.coerce.date()` (zod 3.25 still emits the target type, not unknown). pnpm typecheck, lint, test now all green across the monorepo. Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
This commit is contained in:
1 parent
ad1e4ecaeb
commit
cdfc685855
3 files changed
+20
-14
No files matched your search
@@ -59,14 +59,17 @@ export const fastRoutes: FastifyPluginAsync = async (fastify) => {
|
||||
});
|
||||
if (!owned) return reply.code(404).send({ error: 'fast_event_not_found' });
|
||||
|
||||
// Costruiamo l'oggetto data omettendo le chiavi non fornite, perché con
|
||||
// `exactOptionalPropertyTypes` Prisma rifiuta `undefined` esplicito.
|
||||
const updateData: Parameters<typeof fastify.prisma.fastEvent.update>[0]['data'] = {};
|
||||
if (data.endedAt) updateData.endedAt = data.endedAt;
|
||||
if (data.status) updateData.status = data.status;
|
||||
if (data.symptoms) updateData.symptoms = JSON.stringify(data.symptoms);
|
||||
if (data.notes != null) updateData.notes = data.notes;
|
||||
|
||||
const event = await fastify.prisma.fastEvent.update({
|
||||
where: { id },
|
||||
data: {
|
||||
endedAt: data.endedAt ?? undefined,
|
||||
status: data.status ?? undefined,
|
||||
symptoms: data.symptoms ? JSON.stringify(data.symptoms) : undefined,
|
||||
notes: data.notes ?? undefined,
|
||||
},
|
||||
data: updateData,
|
||||
});
|
||||
return { event: { id: event.id, status: event.status } };
|
||||
});
|
||||
|
||||
Reference in new issue
Block a user