From c18851fba8f843ede822398d729925cd1e27dd7a Mon Sep 17 00:00:00 2001 From: Harkamal Randhawa Date: Wed, 15 Apr 2026 07:03:35 -0600 Subject: [PATCH] fix appointment history --- web/app/appointments/page.js | 88 +++++++++++++++++------------------- 1 file changed, 41 insertions(+), 47 deletions(-) diff --git a/web/app/appointments/page.js b/web/app/appointments/page.js index 2dffe6bb..58b741f9 100644 --- a/web/app/appointments/page.js +++ b/web/app/appointments/page.js @@ -961,45 +961,8 @@ const canBookAppointments = user?.role === "CUSTOMER" || user?.role === "ADMIN"; ) : null}
-

- {adoptionMode ? "Your Adoptions" : canBookAppointments ? "Your Appointments" : "Appointments"} -

- {adoptionMode ? ( - loadingAdoptions ? ( -

Loading adoptions...

- ) : adoptions.length === 0 ? ( -

No adoption appointments yet.

- ) : ( -
- {adoptions.map((a) => ( -
-
- {a.petName} - - {a.adoptionStatus} - -
-
- {a.sourceStoreName} - {a.adoptionDate} -
- {a.adoptionStatus?.toLowerCase() === "pending" && ( -
- -
- )} -
- ))} -
- ) - ) : loadingAppointments ? ( +

{canBookAppointments ? "Your Appointments" : "Appointments"}

+ {loadingAppointments ? (

Loading appointments...

) : appointments.length === 0 ? (

No appointments yet.

@@ -1009,7 +972,7 @@ const canBookAppointments = user?.role === "CUSTOMER" || user?.role === "ADMIN";
{a.serviceName} - + {a.appointmentStatus}
@@ -1017,14 +980,9 @@ const canBookAppointments = user?.role === "CUSTOMER" || user?.role === "ADMIN"; {a.storeName} {a.appointmentDate} at {formatTime(a.appointmentTime)}
- {a.petNames && a.petNames.length > 0 && ( + {a.petName && (
- Pets: {a.petNames.join(", ")} -
- )} - {a.customerPetNames && a.customerPetNames.length > 0 && ( -
- Pets: {a.customerPetNames.join(", ")} + Pet: {a.petName}
)} {a.appointmentStatus?.toLowerCase() === "booked" && ( @@ -1043,6 +1001,42 @@ const canBookAppointments = user?.role === "CUSTOMER" || user?.role === "ADMIN"; ))}
)} + +

{canBookAppointments ? "Your Adoptions" : "Adoptions"}

+ {loadingAdoptions ? ( +

Loading adoptions...

+ ) : adoptions.length === 0 ? ( +

No adoption requests yet.

+ ) : ( +
+ {adoptions.map((a) => ( +
+
+ {a.petName} + + {a.adoptionStatus} + +
+
+ {a.sourceStoreName} + {a.adoptionDate} +
+ {a.adoptionStatus?.toLowerCase() === "pending" && ( +
+ +
+ )} +
+ ))} +
+ )}