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

@@ -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) {

View File

@@ -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({

View File

@@ -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 {