fix bug dashboard bugs & handle request update data in user profile & change design button in home page
This commit is contained in:
@@ -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);
|
||||
});
|
||||
};
|
||||
|
||||
Reference in New Issue
Block a user