From 3296977a6aa85ba6716827054ac113eb6bc71821 Mon Sep 17 00:00:00 2001 From: saridsa2 Date: Mon, 13 Apr 2026 13:16:31 +0530 Subject: [PATCH] fix: branch column shows clinic name instead of department Appointments page was using department for the Branch column. Now fetches doctor.clinic.clinicName from the GraphQL query and displays that. Search filter also updated. Co-Authored-By: Claude Opus 4.6 (1M context) --- src/pages/appointments.tsx | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) 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';