let where: Prisma.ClinicWhereInput = baseWhere;
if (diseaseTreatment && diseaseTreatment.specialization) {
const specializations = diseaseTreatment.specialization.includes(",")
? diseaseTreatment.specialization.split(",").map(s => s.trim())
: [diseaseTreatment.specialization];
if (diseaseTreatment.treatmentCategory === "GP") {
where = {
...baseWhere,
OR: [
{ category: { equals: diseaseTreatment.treatmentCategory } },
{ specialization: { in: specializations } },
],
};
} else if (diseaseTreatment.treatmentCategory === "Specialist") {
where = {
...baseWhere,
specialization: { in: specializations },
};
}
}
For some reason, the search filters are not working, as it doesnt filter the clinics successfully.