add patient and save and schedule all fixed in both pages,
This commit is contained in:
@@ -166,7 +166,7 @@ export const AddPatientModal = forwardRef<
|
||||
)}
|
||||
|
||||
<Button
|
||||
type="submit"
|
||||
type="button"
|
||||
form="patient-form"
|
||||
onClick={() => {
|
||||
if (patientFormRef.current) {
|
||||
|
||||
@@ -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({
|
||||
|
||||
@@ -86,7 +86,6 @@ export default function PatientsPage() {
|
||||
const [uploadedFile, setUploadedFile] = useState<File | null>(null);
|
||||
const [isUploading, setIsUploading] = useState(false);
|
||||
const [isExtracting, setIsExtracting] = useState(false);
|
||||
const [extractedInfo, setExtractedInfo] = useState<any>(null);
|
||||
|
||||
// Fetch patients
|
||||
const {
|
||||
|
||||
Reference in New Issue
Block a user