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:
@@ -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
@@ -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>
|
||||
|
||||
Reference in New Issue
Block a user