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/**/*" ] }