Form validation, navbar improvements, logout functionality, order cancelling
This commit is contained in:
@@ -23,12 +23,13 @@ async function onSubmit(values : any, { setErrors } : any) {
|
||||
console.log(error.response);
|
||||
if(error.response.status == 401) {
|
||||
setErrors({ apiError: "unauthorized" })
|
||||
return;
|
||||
}
|
||||
});
|
||||
if(body != undefined && body.status == 200) {
|
||||
const userStore = useUserStore();
|
||||
localStorage.setItem("username", username);
|
||||
localStorage.setItem("username", body.data.displayName);
|
||||
storeToRefs(userStore).username = body.data.displayName;
|
||||
storeToRefs(userStore).logoutButtonText = body.data.displayName;
|
||||
await router.push('/');
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user