Refactor, improving responsivness
This commit is contained in:
@@ -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('/');
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user