handle change data in doctor model, set previous data when user close modal, update list doctor after update data and change key name in url

This commit is contained in:
Ehsan
2025-09-05 23:05:02 +03:30
parent ebfe47468c
commit dc40129034
13 changed files with 175 additions and 56 deletions
+1
View File
@@ -24,6 +24,7 @@ function ModalSearchCity({
const states = addLabelToList(statesData);
const cities = addLabelToList(citiesData);
const [filteredCities, setFilteredCities] = useState([]);
state;
const handleClose = () => setOpen(false);
+3 -5
View File
@@ -10,8 +10,8 @@ async function Doctors({ searchParams }) {
try {
const params = {};
if (matchedCity) params.city = matchedCity;
if (matchedState) params.state = matchedState;
if (matchedCity) params.city = matchedCity?.id || null;
if (matchedState) params.state = matchedState?.id || null;
const response = await axios.get(
"https://back-dev.clinic-pro.ir/api/v1/doctors",
{
@@ -19,9 +19,7 @@ async function Doctors({ searchParams }) {
}
);
doctors = response.data.data;
} catch (error) {
// console.error("problem with req:", error.message);
}
} catch (error) {}
return (
<Layout>