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 <noreply@anthropic.com>
This commit is contained in:
colinislit
2026-07-09 23:07:00 +02:00
parent cdeea793bd
commit d08db12765
2 changed files with 5 additions and 3 deletions

View File

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

View File

@@ -38,6 +38,7 @@
],
"exclude": [
"node_modules",
"app/epd/_archive/**/*"
"app/epd/_archive/**/*",
"tests/**/*"
]
}