change key field to specialty, filter list doctors with name, remove loading state from doctors page, save state id in url
This commit is contained in:
@@ -19,13 +19,13 @@ function ButtonApply({
|
||||
setLoading(true);
|
||||
|
||||
const params = new URLSearchParams(window.location.search);
|
||||
const field = params.get("field");
|
||||
const specialty = params.get("specialty");
|
||||
const gender = params.get("gender");
|
||||
const degree = params.get("degree");
|
||||
const turn = params.get("turn");
|
||||
|
||||
const requestData = {
|
||||
field: field === "null" ? null : field,
|
||||
specialty: specialty === "null" ? null : specialty,
|
||||
gender,
|
||||
degree,
|
||||
turn,
|
||||
@@ -38,7 +38,7 @@ function ButtonApply({
|
||||
.then((res) => {
|
||||
if (res && res.data) setDoctors(res.data);
|
||||
})
|
||||
.catch((err) => {})
|
||||
.catch(() => {})
|
||||
.finally(() => {
|
||||
setOpen(false);
|
||||
setLoading(false);
|
||||
@@ -50,7 +50,7 @@ function ButtonApply({
|
||||
|
||||
const mappings = [
|
||||
{
|
||||
key: "field",
|
||||
key: "specialty",
|
||||
getValue: () => {
|
||||
if (data.category) {
|
||||
const children = specialties.filter(
|
||||
|
||||
@@ -31,7 +31,7 @@ function FilterModal({
|
||||
const deleteData = () => {
|
||||
clearFilterParams(router, [
|
||||
"turn",
|
||||
"field",
|
||||
"specialty",
|
||||
"degree",
|
||||
"category",
|
||||
"gender",
|
||||
|
||||
@@ -15,14 +15,14 @@ function Form({ data, changeData }) {
|
||||
list={parentList}
|
||||
label="دسته بندی"
|
||||
value={data.category}
|
||||
updateData={(value) => changeData(value, "category", true, "field")}
|
||||
updateData={(value) => changeData(value, "category", true, "specialty")}
|
||||
/>
|
||||
{!!childrenList.length && (
|
||||
<div className="mt-[24px]">
|
||||
<CateSelector
|
||||
list={childrenList}
|
||||
updateData={(value) =>
|
||||
changeData(value, "specialties", false, "field")
|
||||
changeData(value, "specialties", false, "specialty")
|
||||
}
|
||||
value={data.specialties}
|
||||
label="تخصص"
|
||||
|
||||
Reference in New Issue
Block a user