Refactor, improving responsivness

This commit is contained in:
2024-08-06 17:08:07 +02:00
parent feee47f464
commit ce89b79074
17 changed files with 262 additions and 225 deletions

View File

@@ -4,7 +4,7 @@ import * as Yup from 'yup';
import { axiosInstance } from '@/main'
import { router } from '@/router/router'
import { useUserStore } from '@/stores/user.store'
import { storeToRefs } from 'pinia'
import { getActivePinia, storeToRefs } from 'pinia'
const schema = Yup.object().shape({
username: Yup.string().required('Nazwa użytkownika jest wymagana'),
@@ -24,9 +24,8 @@ async function onSubmit(values : any, { setErrors } : any) {
});
if(body != undefined && body.status == 200) {
const userStore = useUserStore();
localStorage.setItem("username", body.data.displayName);
storeToRefs(userStore).username = body.data.displayName;
storeToRefs(userStore).logoutButtonText = body.data.displayName;
const { username } = storeToRefs(userStore);
username.value = body.data.displayName;
await router.push('/');
}