refactor: add opts headOfficeId
This commit is contained in:
parent
8a2c94028b
commit
0a8d9cf143
1 changed files with 10 additions and 2 deletions
|
|
@ -260,12 +260,20 @@ const useBranchStore = defineStore('api-branch', () => {
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
async function stats() {
|
async function stats(opts?: { headOfficeId?: string }) {
|
||||||
|
const params = new URLSearchParams();
|
||||||
|
|
||||||
|
for (const [k, v] of Object.entries(opts || {})) {
|
||||||
|
v !== undefined && params.append(k, v.toString());
|
||||||
|
}
|
||||||
|
|
||||||
|
const query = params.toString();
|
||||||
|
|
||||||
const res = await api.get<{
|
const res = await api.get<{
|
||||||
hq: number;
|
hq: number;
|
||||||
br: number;
|
br: number;
|
||||||
virtual: number;
|
virtual: number;
|
||||||
}>('/branch/stats', {
|
}>(`/branch/stats${(params && '?'.concat(query)) || ''}`, {
|
||||||
headers: {
|
headers: {
|
||||||
'X-Rtid': flowStore.rtid,
|
'X-Rtid': flowStore.rtid,
|
||||||
},
|
},
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue