diff --git a/src/pages/appointments.tsx b/src/pages/appointments.tsx index 3ee3c3b..9ee193a 100644 --- a/src/pages/appointments.tsx +++ b/src/pages/appointments.tsx @@ -58,7 +58,7 @@ const QUERY = `{ appointments(first: 100, orderBy: [{ scheduledAt: DescNullsLast id scheduledAt durationMin appointmentType status doctorName department reasonForVisit patient { id fullName { firstName lastName } phones { primaryPhoneNumber } } - doctor { id } + doctor { id clinic { clinicName } } } } } }`; const formatDate = (iso: string): string => formatDateOnly(iso); @@ -103,7 +103,7 @@ export const AppointmentsPage = () => { const phone = a.patient?.phones?.primaryPhoneNumber ?? ''; const doctor = (a.doctorName ?? '').toLowerCase(); const dept = (a.department ?? '').toLowerCase(); - const branch = (a.department ?? '').toLowerCase(); + const branch = (a.doctor?.clinic?.clinicName ?? '').toLowerCase(); return patientName.includes(q) || phone.includes(q) || doctor.includes(q) || dept.includes(q) || branch.includes(q); }); } @@ -177,7 +177,7 @@ export const AppointmentsPage = () => { ? `${appt.patient.fullName?.firstName ?? ''} ${appt.patient.fullName?.lastName ?? ''}`.trim() || 'Unknown' : 'Unknown'; const phone = appt.patient?.phones?.primaryPhoneNumber ?? ''; - const branch = appt.department ?? '—'; + const branch = appt.doctor?.clinic?.clinicName ?? '—'; const statusLabel = STATUS_LABELS[appt.status ?? ''] ?? appt.status ?? '—'; const statusColor = STATUS_COLORS[appt.status ?? ''] ?? 'gray';