mirror of
https://github.com/ClaytonWWilson/CS307-Team24.git
synced 2025-12-16 10:18:48 +00:00
Delete Account works on the UI now
This commit is contained in:
parent
ad853923c8
commit
45f88861c8
@ -62,6 +62,20 @@ export const logoutUser = () => (dispatch) => {
|
|||||||
}
|
}
|
||||||
|
|
||||||
export const deleteUser = () => (dispatch) => {
|
export const deleteUser = () => (dispatch) => {
|
||||||
|
axios
|
||||||
|
.delete("/delete")
|
||||||
|
.then((res) => {
|
||||||
|
console.log(res);
|
||||||
|
console.log("User account successfully deleted.");
|
||||||
|
}
|
||||||
|
)
|
||||||
|
.catch((err) => {
|
||||||
|
dispatch ({
|
||||||
|
type: SET_ERRORS,
|
||||||
|
payload: err.response.data,
|
||||||
|
})
|
||||||
|
});
|
||||||
|
|
||||||
localStorage.removeItem('FBIdToken');
|
localStorage.removeItem('FBIdToken');
|
||||||
delete axios.defaults.headers.common['Authorization'];
|
delete axios.defaults.headers.common['Authorization'];
|
||||||
dispatch({ type: SET_UNAUTHENTICATED });
|
dispatch({ type: SET_UNAUTHENTICATED });
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user