feat: update QueryForDoctorsReq and buildDoctorParams to use *_id for specialty, city, and state
This commit is contained in:
+7
-7
@@ -425,13 +425,13 @@ export const QueryForDoctorsReq = (newFilter) => {
|
||||
if (newFilter.active === 1) params.active = 1;
|
||||
|
||||
if (newFilter.specialty?.id) {
|
||||
params.specialty = newFilter.specialty.id;
|
||||
params.specialty_id = newFilter.specialty.id;
|
||||
} else if (newFilter.category?.id) {
|
||||
params.specialty = newFilter.category.id;
|
||||
params.specialty_id = newFilter.category.id;
|
||||
}
|
||||
|
||||
if (newFilter.city?.id) params.city = newFilter.city.id;
|
||||
if (newFilter.state?.id) params.state = newFilter.state.id;
|
||||
if (newFilter.city?.id) params.city_id = newFilter.city.id;
|
||||
if (newFilter.state?.id) params.state_id = newFilter.state.id;
|
||||
|
||||
if (newFilter.degree && newFilter.degree !== "همه موارد")
|
||||
switch (newFilter.degree) {
|
||||
@@ -516,7 +516,7 @@ export const buildDoctorParams = (searchParams) => {
|
||||
if (searchParams.specialty) {
|
||||
const spec = specialties.find((s) => s.name === searchParams.specialty);
|
||||
if (spec) {
|
||||
params.specialty = spec.id;
|
||||
params.specialty_id = spec.id;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -524,7 +524,7 @@ export const buildDoctorParams = (searchParams) => {
|
||||
if (searchParams.city) {
|
||||
const cityObj = cities.find((c) => c.name === searchParams.city);
|
||||
if (cityObj) {
|
||||
params.city = cityObj.id;
|
||||
params.city_id = cityObj.id;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -532,7 +532,7 @@ export const buildDoctorParams = (searchParams) => {
|
||||
if (searchParams.state) {
|
||||
const stateObj = states.find((s) => s.name === searchParams.state);
|
||||
if (stateObj) {
|
||||
params.state = stateObj.id;
|
||||
params.state_id = stateObj.id;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user