diff --git a/src/stores/product-service/index.ts b/src/stores/product-service/index.ts index 59badc61..6e81a2c9 100644 --- a/src/stores/product-service/index.ts +++ b/src/stores/product-service/index.ts @@ -23,7 +23,11 @@ import { import { ref } from 'vue'; import useFlowStore from '../flow'; +import useMyBranchStore from 'src/stores/my-branch'; + const useProductServiceStore = defineStore('api-product-service', () => { + const useMyBranch = useMyBranchStore(); + // Product Type const flowStore = useFlowStore(); @@ -301,6 +305,10 @@ const useProductServiceStore = defineStore('api-product-service', () => { v !== undefined && params.append(k, v.toString()); } + if (useMyBranch.myBranch?.length !== 0 && useMyBranch.myBranch) { + params.append('registeredBranchId', useMyBranch.myBranch[0].id); + } + const query = params.toString(); const res = await api.get>( @@ -429,6 +437,10 @@ const useProductServiceStore = defineStore('api-product-service', () => { v !== undefined && params.append(k, v.toString()); } + if (useMyBranch.myBranch?.length !== 0 && useMyBranch.myBranch) { + params.append('registeredBranchId', useMyBranch.myBranch[0].id); + } + const query = params.toString(); const res = await api.get>( @@ -733,6 +745,10 @@ const useProductServiceStore = defineStore('api-product-service', () => { v !== undefined && params.append(k, v.toString()); } + if (useMyBranch.myBranch?.length !== 0 && useMyBranch.myBranch) { + params.append('registeredBranchId', useMyBranch.myBranch[0].id); + } + const query = params.toString(); const res = await api.get>(