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/Dashboard.js

    re1f74f6 r9af201e  
    66import { labService } from '../services/labService';
    77import { billingService } from '../services/billingService';
    8 import { medicalRecordService } from '../services/medicalRecordService';
    98import Loading from '../components/Loading';
    109
     
    1918  const [pendingLabTests, setPendingLabTests] = useState([]);
    2019  const [billings, setBillings] = useState([]);
    21   const [medicalRecords, setMedicalRecords] = useState([]);
    2220  const [patientBillings, setPatientBillings] = useState([]);
    2321  const [loading, setLoading] = useState(true);
     
    3331        if (isPatient) {
    3432          // For patients, fetch their own appointments, medical records, and billing
    35           const [appointmentsRes, medicalRes, billingRes] = await Promise.all([
     33          const [appointmentsRes, billingRes] = await Promise.all([
    3634            appointmentService.getAppointmentsForPatient(user.patientId),
    37             medicalRecordService.getMedicalRecordByPatientId(user.patientId),
    3835            billingService.getBillingHistoryForPatient(user.patientId)
    3936          ]);
    4037          setUserAppointments(appointmentsRes.data || []);
    41           // Handle medical records - could be single object or array
    42           const medicalData = medicalRes.data;
    43           const medicalArray = Array.isArray(medicalData) ? medicalData : (medicalData ? [medicalData] : []);
    44           setMedicalRecords(medicalArray);
    4538          setPatientBillings(billingRes.data || []);
    4639        } else if (isDoctor) {
     
    8275
    8376    fetchStats();
    84   }, [user.userId, isPatient, isDoctor, isLabTechnician]);
     77  }, []);
    8578
    8679  if (loading) return <Loading />;
Note: See TracChangeset for help on using the changeset viewer.