in page add doctor change data state & component & save data & request to send data & change component folder
This commit is contained in:
@@ -29,15 +29,12 @@ function ModalSearchCity() {
|
||||
second: "",
|
||||
});
|
||||
|
||||
// Load states and cities from JSON files
|
||||
useEffect(() => {
|
||||
// Format states data to match the structure expected by AutoCompleteSelect
|
||||
const formattedStates = statesData.map((state) => ({
|
||||
label: state.name,
|
||||
id: state.id,
|
||||
}));
|
||||
|
||||
// Format cities data
|
||||
const formattedCities = citiesData.map((city) => ({
|
||||
label: city.name,
|
||||
id: city.id,
|
||||
@@ -48,7 +45,6 @@ function ModalSearchCity() {
|
||||
setCities(formattedCities);
|
||||
}, []);
|
||||
|
||||
// Filter cities when state is selected
|
||||
useEffect(() => {
|
||||
if (selected.first) {
|
||||
const selectedState = states.find(
|
||||
@@ -69,7 +65,6 @@ function ModalSearchCity() {
|
||||
|
||||
const updateData = (event, name) => {
|
||||
if (name === "first" && event !== selected.first) {
|
||||
// If state changes, reset city selection
|
||||
setSelected({ first: event, second: "" });
|
||||
} else {
|
||||
setSelected({ ...selected, [name]: event });
|
||||
|
||||
Reference in New Issue
Block a user