fix: getStatsEmployeeGender รับ opts

This commit is contained in:
Net 2024-07-03 10:47:50 +07:00
parent 4bb45992e2
commit 6090a1a4b0

View file

@ -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,