JWT refresh

This commit is contained in:
2020-11-29 20:23:20 +01:00
parent e48d300ca9
commit 6d02533d69
18 changed files with 69 additions and 22 deletions

View File

@@ -173,7 +173,7 @@ export default function EditRestaurantInfo(props) {
},
})
.then((response) => {
dispatch(refreshUserData(jwt));
dispatch(refreshUserData());
setState({ ...state, hidden: !state.hidden });
dispatch(hideBackdrop());
dispatch(notification("Widoczność zmieniona poprawnie", "success"));
@@ -182,6 +182,7 @@ export default function EditRestaurantInfo(props) {
console.log(err);
dispatch(hideBackdrop());
dispatch(notification("Wystąpił błąd :(", "error"));
throw err;
});
}
@@ -200,7 +201,7 @@ export default function EditRestaurantInfo(props) {
},
})
.then((response) => {
dispatch(refreshUserData(jwt));
dispatch(refreshUserData());
dispatch(hideBackdrop());
dispatch(notification("Restauracja została usunięta", "success"));
history.push("/");
@@ -209,6 +210,7 @@ export default function EditRestaurantInfo(props) {
console.log(err);
dispatch(hideBackdrop());
dispatch(notification("Wystąpił nieoczekiwany błąd :(", "error"));
throw err;
});
};
@@ -257,6 +259,7 @@ export default function EditRestaurantInfo(props) {
console.log(err);
dispatch(hideBackdrop());
dispatch(notification("Wystąpił nieoczekiwany błąd :(", "error"));
throw err;
});
}
};