refactor: query registeredBranchId

This commit is contained in:
Net 2024-07-05 11:08:59 +07:00
parent c58c225a13
commit d26c2df793

View file

@ -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[]>>(