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:
@@ -273,6 +273,7 @@ export default function AppointmentsPage() {
|
||||
if (!canEditPatients) {
|
||||
return;
|
||||
}
|
||||
setPatientForm(EMPTY_PATIENT_FORM);
|
||||
setIsCreateOpen(true);
|
||||
}}
|
||||
/>
|
||||
@@ -322,18 +323,18 @@ export default function AppointmentsPage() {
|
||||
deleting={deletingAppointment}
|
||||
/>
|
||||
|
||||
{isCreateOpen && (
|
||||
<div className="fixed inset-0 z-[60] flex items-center justify-center p-4 bg-black/55">
|
||||
<CreatePatientModal
|
||||
isOpen={isCreateOpen}
|
||||
formData={patientForm}
|
||||
onChange={(patch) => setPatientForm((prev) => ({ ...prev, ...patch }))}
|
||||
onSubmit={() => void handleCreatePatient()}
|
||||
onClose={() => setIsCreateOpen(false)}
|
||||
loading={savingPatient}
|
||||
/>
|
||||
</div>
|
||||
)}
|
||||
<CreatePatientModal
|
||||
variant="dialog"
|
||||
isOpen={isCreateOpen}
|
||||
formData={patientForm}
|
||||
onChange={(patch) => setPatientForm((prev) => ({ ...prev, ...patch }))}
|
||||
onSubmit={() => void handleCreatePatient()}
|
||||
onClose={() => {
|
||||
setIsCreateOpen(false);
|
||||
setPatientForm(EMPTY_PATIENT_FORM);
|
||||
}}
|
||||
loading={savingPatient}
|
||||
/>
|
||||
|
||||
</div>
|
||||
);
|
||||
|
||||
@@ -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}
|
||||
/>
|
||||
)}
|
||||
|
||||
Reference in New Issue
Block a user