normalize pet status casing

This commit is contained in:
2026-04-16 07:58:46 -06:00
parent 2c9dedb65e
commit d26c963ee8

View File

@@ -603,7 +603,7 @@ const canBookAppointments = user?.role === "CUSTOMER" || user?.role === "ADMIN";
}, [storeId, serviceId, appointmentDate]);
const eligiblePets = customerPets.filter(
(p) => p.petStatus === "Owned" || p.petStatus === "Adopted"
(p) => p.petStatus?.toLowerCase() === "owned" || p.petStatus?.toLowerCase() === "adopted"
);
const selectedService = services.find((s) => s.serviceId === Number(serviceId));
@@ -663,7 +663,7 @@ const canBookAppointments = user?.role === "CUSTOMER" || user?.role === "ADMIN";
return;
}
if (!adoptionMode && selectedPet && selectedPet.petStatus !== "Owned" && selectedPet.petStatus !== "Adopted") {
if (!adoptionMode && selectedPet && selectedPet.petStatus?.toLowerCase() !== "owned" && selectedPet.petStatus?.toLowerCase() !== "adopted") {
setError("The selected pet is no longer eligible for appointments. Please refresh the page.");
return;
}