refactor: extract navigator into store instead

This commit is contained in:
Methapon Metanipat 2024-10-30 11:55:43 +07:00
parent caa3e59777
commit 6b29d3b017
10 changed files with 68 additions and 76 deletions

View file

@ -6,7 +6,8 @@ import { storeToRefs } from 'pinia';
// NOTE: Import stores
import { useQuotationStore } from 'src/stores/quotations';
import useUtilsStore, { isRoleInclude } from 'stores/utils';
import { isRoleInclude } from 'stores/utils';
import { useNavigator } from 'src/stores/navigator';
import useFlowStore from 'src/stores/flow';
import useMyBranch from 'stores/my-branch';
import { useQuotationForm } from './form';
@ -44,7 +45,7 @@ const quotationFormStore = useQuotationForm();
const customerFormStore = useCustomerForm();
const flowStore = useFlowStore();
const userBranch = useMyBranch();
const utilsStore = useUtilsStore();
const navigatorStore = useNavigator();
const {
currentFormData: quotationFormData,
@ -220,8 +221,8 @@ const {
} = storeToRefs(quotationStore);
onMounted(async () => {
utilsStore.currentTitle.title = 'quotation.title';
utilsStore.currentTitle.path = [
navigatorStore.current.title = 'quotation.title';
navigatorStore.current.path = [
{
text: 'quotation.caption',
i18n: true,