fix bug dashboard bugs & handle request update data in user profile & change design button in home page

This commit is contained in:
Ehsan
2025-06-13 22:12:58 +03:30
parent eea8737778
commit 891b0e8273
9 changed files with 23 additions and 24 deletions
@@ -19,14 +19,12 @@ function Information({
const [insurance, setInsurance] = useState();
useEffect(() => {
request
.getInsuranceType()
.then((res) => {
if (res && res.data) {
setInsurance(res.data);
}
})
// .catch((err) => {});
request.getInsuranceType().then((res) => {
if (res && res.data) {
setInsurance(res.data);
}
});
// .catch((err) => {});
}, []);
const changeData = (value, type, name) => {
@@ -39,17 +37,19 @@ function Information({
const sendReq = () => {
setLoading(true);
console.log(data);
request[dataUser ? "patchUserProfile" : "postUserProfile"](
data,
dataUser ? dataUser.uuid : Cookies.get("uuid")
)
.then((res) => {
.then(() => {
if (!dataUser) {
updateDataUser();
}
setLoading(false);
})
.catch((err) => {
.catch(() => {
setLoading(false);
});
};