add patient and save and schedule all fixed in both pages,

This commit is contained in:
2025-05-16 15:27:38 +05:30
parent 81accf6695
commit f304cccc68
3 changed files with 6 additions and 3 deletions

View File

@@ -139,7 +139,7 @@ export default function Dashboard() {
const res = await apiRequest("POST", "/api/patients/", patient);
return res.json();
},
onSuccess: () => {
onSuccess: (newPatient) => {
setIsAddPatientOpen(false);
queryClient.invalidateQueries({ queryKey: ["/api/patients/"] });
toast({
@@ -147,6 +147,10 @@ export default function Dashboard() {
description: "Patient added successfully!",
variant: "default",
});
if (addPatientModalRef.current?.shouldSchedule) {
addPatientModalRef.current.navigateToSchedule(newPatient.id);
}
},
onError: (error) => {
toast({