fix: getStatsEmployeeGender รับ opts
This commit is contained in:
parent
4bb45992e2
commit
6090a1a4b0
1 changed files with 15 additions and 2 deletions
|
|
@ -234,15 +234,28 @@ const useEmployeeStore = defineStore('api-employee', () => {
|
|||
}
|
||||
|
||||
async function getStatsEmployeeGender(
|
||||
customerBranchId?: string,
|
||||
opts?: {
|
||||
customerBranchId?: string;
|
||||
status?: 'CREATED' | 'ACTIVE' | 'INACTIVE';
|
||||
query?: string;
|
||||
},
|
||||
|
||||
flow?: {
|
||||
sessionId?: string;
|
||||
refTransactionId?: string;
|
||||
transactionId?: 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(
|
||||
`/employee/stats/gender${customerBranchId ? '?customerBranchId=' + customerBranchId : ''}/`,
|
||||
`/employee/stats/gender${(params && '?'.concat(query)) || ''}`,
|
||||
{
|
||||
headers: {
|
||||
'X-Session-Id': flow?.sessionId,
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue