Changeset 9af201e for frontend/src/pages/appointments/AppointmentForm.js
- Timestamp:
- 09/04/26 19:08:08 (2 weeks ago)
- Branches:
- master
- Children:
- cdcff72
- Parents:
- e1f74f6
- File:
-
- 1 edited
-
frontend/src/pages/appointments/AppointmentForm.js (modified) (1 diff)
Legend:
- Unmodified
- Added
- Removed
-
frontend/src/pages/appointments/AppointmentForm.js
re1f74f6 r9af201e 26 26 27 27 useEffect(() => { 28 const fetchData = async () => { 29 try { 30 if (!isPatient) { 31 const patientsRes = await patientService.getAllPatients(); 32 setPatients(patientsRes.data); 33 } 34 35 const doctorsRes = await doctorService.getAllDoctors(); 36 setDoctors(doctorsRes.data); 37 } catch (err) { 38 setError('Failed to fetch doctors'); 39 } 40 }; 41 28 42 fetchData(); 29 }, []); 30 31 const fetchData = async () => { 32 try { 33 // For patients, we don't need to fetch all patients 34 if (!isPatient) { 35 const patientsRes = await patientService.getAllPatients(); 36 setPatients(patientsRes.data); 37 } 38 39 const doctorsRes = await doctorService.getAllDoctors(); 40 setDoctors(doctorsRes.data); 41 } catch (err) { 42 setError('Failed to fetch doctors'); 43 } 44 }; 43 }, [isPatient]); 45 44 46 45 const handleChange = (e) => {
Note:
See TracChangeset
for help on using the changeset viewer.
