bugfix: click on new patient button resets the patient data entry form now. appointment's add patient flow updated so that it matches tha patients feature.

This commit is contained in:
2026-05-18 13:09:46 +03:30
parent 3b12c52fd3
commit 535b49310f
4 changed files with 107 additions and 26 deletions

View File

@@ -147,6 +147,7 @@ export default function PatientsPage() {
onClick={() => {
if (!canEditPatients) return;
toast.clear();
setPatientForm(EMPTY_PATIENT_FORM);
setIsCreateOpen(true);
}}
title={!canEditPatients ? 'Read-only access for this organization.' : undefined}
@@ -163,7 +164,10 @@ export default function PatientsPage() {
formData={patientForm}
onChange={(patch) => setPatientForm((prev) => ({ ...prev, ...patch }))}
onSubmit={() => void handleCreatePatient()}
onClose={() => setIsCreateOpen(false)}
onClose={() => {
setIsCreateOpen(false);
setPatientForm(EMPTY_PATIENT_FORM);
}}
loading={savingPatient}
/>
)}