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:
Ehsan
2025-09-07 10:22:53 +03:30
parent dc40129034
commit 10d4c39a4d
11 changed files with 142 additions and 59 deletions
+4 -4
View File
@@ -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(
+1 -1
View File
@@ -31,7 +31,7 @@ function FilterModal({
const deleteData = () => {
clearFilterParams(router, [
"turn",
"field",
"specialty",
"degree",
"category",
"gender",
+2 -2
View File
@@ -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="تخصص"