Form validation, navbar improvements, logout functionality, order cancelling

This commit is contained in:
2024-07-03 09:36:40 +02:00
parent 673eb10b7b
commit 200242252c
8 changed files with 43 additions and 23 deletions

View File

@@ -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('/');
}