normalize pet status casing
This commit is contained in:
@@ -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;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user