This commit is contained in:
2024-09-03 10:28:57 +02:00
parent d7e28cd926
commit 8140233e3a
5 changed files with 47 additions and 7 deletions

View File

@@ -5,6 +5,8 @@ import { axiosInstance } from '@/main'
import { router } from '@/router/router'
import { useUserStore } from '@/stores/user.store'
import { getActivePinia, storeToRefs } from 'pinia'
import { useCategoriesStore } from '@/stores/categories.store'
import { useSiteControlStore } from '@/stores/siteControl.store'
const schema = Yup.object().shape({
username: Yup.string().required('Nazwa użytkownika jest wymagana'),
@@ -24,9 +26,10 @@ async function onSubmit(values : any, { setErrors } : any) {
});
if(body != undefined && body.status == 200) {
const userStore = useUserStore();
const siteControlStore = useSiteControlStore();
const { username } = storeToRefs(userStore);
username.value = body.data.displayName;
await router.push('/');
await siteControlStore.newOrder(true);
}
}