feat: branch userStats (store, type)
This commit is contained in:
parent
44b3fa97aa
commit
e2b954965e
2 changed files with 32 additions and 0 deletions
|
|
@ -225,6 +225,29 @@ const useBranchStore = defineStore('api-branch', () => {
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
async function userStats(
|
||||||
|
userType: string,
|
||||||
|
flow?: {
|
||||||
|
sessionId: string;
|
||||||
|
refTransactionId: string;
|
||||||
|
transactionId: string;
|
||||||
|
},
|
||||||
|
) {
|
||||||
|
const res = await api.get(`/branch/user-stats`, {
|
||||||
|
headers: {
|
||||||
|
'X-Session-Id': flow?.sessionId,
|
||||||
|
'X-Rtid': flow?.refTransactionId,
|
||||||
|
'X-Tid': flow?.transactionId,
|
||||||
|
},
|
||||||
|
data: userType
|
||||||
|
});
|
||||||
|
|
||||||
|
if (!res) return false;
|
||||||
|
if (res.status === 200) return res.data;
|
||||||
|
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
|
||||||
return {
|
return {
|
||||||
data,
|
data,
|
||||||
fetchList,
|
fetchList,
|
||||||
|
|
@ -237,6 +260,8 @@ const useBranchStore = defineStore('api-branch', () => {
|
||||||
getUser,
|
getUser,
|
||||||
addUser,
|
addUser,
|
||||||
removeUser,
|
removeUser,
|
||||||
|
|
||||||
|
userStats,
|
||||||
};
|
};
|
||||||
});
|
});
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -47,3 +47,10 @@ export type BranchCreate = {
|
||||||
provinceId?: string | null;
|
provinceId?: string | null;
|
||||||
headOfficeId?: string | null;
|
headOfficeId?: string | null;
|
||||||
};
|
};
|
||||||
|
|
||||||
|
export type BranchUserStats = {
|
||||||
|
id: string,
|
||||||
|
nameEN: string,
|
||||||
|
name: string;
|
||||||
|
count: 0
|
||||||
|
}
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue