update src/views/Address/index.js, src/views/Dashboard/layouts/Main/index.js and src/views/ShoppingCart/index.js

temp
mahdi 2 years ago
parent 5f92293b2a
commit 31a19d10ad
  1. 12
      src/views/Address/index.js
  2. 6
      src/views/Dashboard/layouts/Main/index.js

@ -87,6 +87,7 @@ export const Address = ({
}, [addressInfo]); }, [addressInfo]);
useEffect(() => { useEffect(() => {
console.log({ addressFields });
if (addressFields?.provinceId) { if (addressFields?.provinceId) {
getCity({ getCity({
provinceId: provinces.filter( provinceId: provinces.filter(
@ -96,6 +97,17 @@ export const Address = ({
} }
}, [addressFields]); }, [addressFields]);
useEffect(() => {
console.log({ profileFields });
if (profileFields?.provinceId) {
getCity({
provinceId: provinces.filter(
(province) => province.name === profileFields?.provinceId
)[0]?.id,
});
}
}, [profileFields]);
const onChange = (name, value) => { const onChange = (name, value) => {
setAddressFields({ ...addressFields, [name]: value }); setAddressFields({ ...addressFields, [name]: value });
}; };

@ -19,9 +19,9 @@ const views = {
<Ticket /> <Ticket />
</div> </div>
), ),
favorites : <Favorites />, favorites: <Favorites />,
addresses : <Addresses />, addresses: <Addresses />,
profile : <Address profilePage={true} />, profile: <Address profilePage={true} />,
}; };
export const Main = ({ setHeaderOptions, page }) => { export const Main = ({ setHeaderOptions, page }) => {

Loading…
Cancel
Save