add loading for redirect button from home to doctors page && change filter for field search in name or specialty and set in url && fix bug select city in home page

This commit is contained in:
ehsan
2025-09-21 23:12:47 +03:30
parent dfc8492afa
commit e11f4ed3c5
8 changed files with 75 additions and 22 deletions
+9 -1
View File
@@ -56,9 +56,17 @@ function Head({ matchedCity, matchedState, setDoctors }) {
};
const sendReq = (newFilter) => {
const params = QueryForDoctorsReq(newFilter || filter);
let filteredName = params;
if (
newFilter.name === newFilter.specialty?.name ||
newFilter.name === newFilter.category?.name
) {
filteredName.name = "";
delete filteredName.name;
}
return request
.getDoctors(params)
.getDoctors(filteredName)
.then((res) => {
setDoctors(res.data);
return res;