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( async function getStatsEmployeeGender(
customerBranchId?: string, opts?: {
customerBranchId?: string;
status?: 'CREATED' | 'ACTIVE' | 'INACTIVE';
query?: string;
},
flow?: { flow?: {
sessionId?: string; sessionId?: string;
refTransactionId?: string; refTransactionId?: string;
transactionId?: 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( const res = await api.get(
`/employee/stats/gender${customerBranchId ? '?customerBranchId=' + customerBranchId : ''}/`, `/employee/stats/gender${(params && '?'.concat(query)) || ''}`,
{ {
headers: { headers: {
'X-Session-Id': flow?.sessionId, 'X-Session-Id': flow?.sessionId,