refactor: query registeredBranchId
This commit is contained in:
parent
c58c225a13
commit
d26c2df793
1 changed files with 16 additions and 0 deletions
|
|
@ -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<Pagination<ProductList[]>>(
|
||||
|
|
@ -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<Pagination<Service[]>>(
|
||||
|
|
@ -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<Pagination<ServiceAndProduct[]>>(
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue