From d08db127656f79b88aae93bbb9a8de31ac5d2c70 Mon Sep 17 00:00:00 2001 From: colinislit Date: Thu, 9 Jul 2026 23:07:00 +0200 Subject: [PATCH] fix(build): resolve type errors blocking production build - agenda-create-form: capture prefilled patient name in const so the async closure sees a narrowed string type - tsconfig: exclude tests/ from next build typecheck (Cypress/Playwright files have their own type context) Co-Authored-By: Claude Fable 5 --- components/cortex/artifacts/blocks/agenda-create-form.tsx | 5 +++-- tsconfig.json | 3 ++- 2 files changed, 5 insertions(+), 3 deletions(-) diff --git a/components/cortex/artifacts/blocks/agenda-create-form.tsx b/components/cortex/artifacts/blocks/agenda-create-form.tsx index f9febdc..85ce0c1 100644 --- a/components/cortex/artifacts/blocks/agenda-create-form.tsx +++ b/components/cortex/artifacts/blocks/agenda-create-form.tsx @@ -91,7 +91,8 @@ export function AgendaCreateForm({ prefillData, onClose }: AgendaCreateFormProps const prefilledPatient = prefillData?.patient; if (!prefilledPatient?.name || prefilledPatient.id || patientId) return; - const normalizedPrefill = normalizePatientName(prefilledPatient.name); + const prefilledPatientName = prefilledPatient.name; + const normalizedPrefill = normalizePatientName(prefilledPatientName); if (autoResolvedPatientRef.current === normalizedPrefill) return; autoResolvedPatientRef.current = normalizedPrefill; @@ -112,7 +113,7 @@ export function AgendaCreateForm({ prefillData, onClose }: AgendaCreateFormProps async function resolvePrefilledPatient() { setIsSearching(true); try { - const res = await fetch(`/api/cortex/patients/search?q=${encodeURIComponent(prefilledPatient.name)}`); + const res = await fetch(`/api/cortex/patients/search?q=${encodeURIComponent(prefilledPatientName)}`); if (!res.ok || cancelled) return; const data = await res.json(); diff --git a/tsconfig.json b/tsconfig.json index 76c5943..0b130d3 100644 --- a/tsconfig.json +++ b/tsconfig.json @@ -38,6 +38,7 @@ ], "exclude": [ "node_modules", - "app/epd/_archive/**/*" + "app/epd/_archive/**/*", + "tests/**/*" ] }