Bugfix 2
This commit is contained in:
29
components.d.ts
vendored
Normal file
29
components.d.ts
vendored
Normal file
@@ -0,0 +1,29 @@
|
||||
/* eslint-disable */
|
||||
// @ts-nocheck
|
||||
// Generated by unplugin-vue-components
|
||||
// Read more: https://github.com/vuejs/core/pull/3399
|
||||
export {}
|
||||
|
||||
/* prettier-ignore */
|
||||
declare module 'vue' {
|
||||
export interface GlobalComponents {
|
||||
CancelationModal: typeof import('./src/components/CancelationModal.vue')['default']
|
||||
Column: typeof import('primevue/column')['default']
|
||||
ConfirmationModal: typeof import('./src/components/ConfirmationModal.vue')['default']
|
||||
ConfirmedForm: typeof import('./src/components/ConfirmedForm.vue')['default']
|
||||
DataTable: typeof import('primevue/datatable')['default']
|
||||
IconCommunity: typeof import('./src/components/icons/IconCommunity.vue')['default']
|
||||
IconDocumentation: typeof import('./src/components/icons/IconDocumentation.vue')['default']
|
||||
IconEcosystem: typeof import('./src/components/icons/IconEcosystem.vue')['default']
|
||||
IconSupport: typeof import('./src/components/icons/IconSupport.vue')['default']
|
||||
IconTooling: typeof import('./src/components/icons/IconTooling.vue')['default']
|
||||
LoadingComponent: typeof import('./src/components/LoadingComponent.vue')['default']
|
||||
LoginModal: typeof import('./src/components/LoginModal.vue')['default']
|
||||
MainForm: typeof import('./src/components/MainForm.vue')['default']
|
||||
NavBar: typeof import('./src/components/NavBar.vue')['default']
|
||||
OrdersSelector: typeof import('./src/components/OrdersSelector.vue')['default']
|
||||
RouterLink: typeof import('vue-router')['RouterLink']
|
||||
RouterView: typeof import('vue-router')['RouterView']
|
||||
SummaryComponent: typeof import('./src/components/SummaryComponent.vue')['default']
|
||||
}
|
||||
}
|
||||
@@ -1,15 +1,16 @@
|
||||
<template>
|
||||
<Suspense>
|
||||
<RouterView class="has-navbar-fixed-top"/>
|
||||
</Suspense>
|
||||
</template>
|
||||
|
||||
<script setup lang="ts">
|
||||
import './assets/style.scss'
|
||||
import './assets/print.css'
|
||||
import { RouterView } from 'vue-router'
|
||||
import { useContractorsStore } from '@/stores/contractors.store'
|
||||
import { useCategoriesStore } from '@/stores/categories.store'
|
||||
|
||||
|
||||
// const categoriesStore = useCategoriesStore();
|
||||
// await categoriesStore.fetchCategories();
|
||||
</script>
|
||||
|
||||
<style>
|
||||
|
||||
@@ -3,7 +3,7 @@
|
||||
import { storeToRefs } from 'pinia'
|
||||
import VueDatePicker from '@vuepic/vue-datepicker'
|
||||
import { useSiteControlStore } from '@/stores/siteControl.store'
|
||||
import { onMounted, ref } from 'vue'
|
||||
import { onBeforeUnmount, onMounted, ref } from 'vue'
|
||||
import { useCategoriesStore } from '@/stores/categories.store'
|
||||
import type { Product } from '@/main'
|
||||
|
||||
@@ -73,6 +73,11 @@
|
||||
console.log(products.value);
|
||||
isLoading.value=false;
|
||||
});
|
||||
|
||||
onBeforeUnmount( async function (){
|
||||
const siteControlStore = useSiteControlStore();
|
||||
await siteControlStore.newOrder(false);
|
||||
})
|
||||
</script>
|
||||
|
||||
<template>
|
||||
|
||||
@@ -68,8 +68,10 @@ export const useSiteControlStore = defineStore('siteControl', () => {
|
||||
deliveryDate.value = undefined;
|
||||
orderDate.value = undefined;
|
||||
await categoriesStore.fetchCategories();
|
||||
if (redirect) {
|
||||
await router.push("/");
|
||||
}
|
||||
}
|
||||
|
||||
return {isLoading, showConfirmationModal, showCancellationModal, isDarkTheme, shownComponent, switchToForm, switchToOrders, switchToTable, checkTheme, viewOrder, newOrder};
|
||||
})
|
||||
@@ -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);
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user