Ignore:
Timestamp:
09/04/26 19:08:08 (2 weeks ago)
Author:
MBK <marija.karapandzova@…>
Branches:
master
Children:
cdcff72
Parents:
e1f74f6
Message:

Fix frontend appearance

File:
1 edited

Legend:

Unmodified
Added
Removed
  • frontend/src/pages/appointments/AppointmentForm.js

    re1f74f6 r9af201e  
    2626
    2727  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
    2842    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]);
    4544
    4645  const handleChange = (e) => {
Note: See TracChangeset for help on using the changeset viewer.