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
|
<Button
|
||||||
type="submit"
|
type="button"
|
||||||
form="patient-form"
|
form="patient-form"
|
||||||
onClick={() => {
|
onClick={() => {
|
||||||
if (patientFormRef.current) {
|
if (patientFormRef.current) {
|
||||||
|
|||||||
@@ -139,7 +139,7 @@ export default function Dashboard() {
|
|||||||
const res = await apiRequest("POST", "/api/patients/", patient);
|
const res = await apiRequest("POST", "/api/patients/", patient);
|
||||||
return res.json();
|
return res.json();
|
||||||
},
|
},
|
||||||
onSuccess: () => {
|
onSuccess: (newPatient) => {
|
||||||
setIsAddPatientOpen(false);
|
setIsAddPatientOpen(false);
|
||||||
queryClient.invalidateQueries({ queryKey: ["/api/patients/"] });
|
queryClient.invalidateQueries({ queryKey: ["/api/patients/"] });
|
||||||
toast({
|
toast({
|
||||||
@@ -147,6 +147,10 @@ export default function Dashboard() {
|
|||||||
description: "Patient added successfully!",
|
description: "Patient added successfully!",
|
||||||
variant: "default",
|
variant: "default",
|
||||||
});
|
});
|
||||||
|
|
||||||
|
if (addPatientModalRef.current?.shouldSchedule) {
|
||||||
|
addPatientModalRef.current.navigateToSchedule(newPatient.id);
|
||||||
|
}
|
||||||
},
|
},
|
||||||
onError: (error) => {
|
onError: (error) => {
|
||||||
toast({
|
toast({
|
||||||
|
|||||||
@@ -86,7 +86,6 @@ export default function PatientsPage() {
|
|||||||
const [uploadedFile, setUploadedFile] = useState<File | null>(null);
|
const [uploadedFile, setUploadedFile] = useState<File | null>(null);
|
||||||
const [isUploading, setIsUploading] = useState(false);
|
const [isUploading, setIsUploading] = useState(false);
|
||||||
const [isExtracting, setIsExtracting] = useState(false);
|
const [isExtracting, setIsExtracting] = useState(false);
|
||||||
const [extractedInfo, setExtractedInfo] = useState<any>(null);
|
|
||||||
|
|
||||||
// Fetch patients
|
// Fetch patients
|
||||||
const {
|
const {
|
||||||
|
|||||||
Reference in New Issue
Block a user