diff --git a/src/stores/employee/index.ts b/src/stores/employee/index.ts index e0530176..471a9db1 100644 --- a/src/stores/employee/index.ts +++ b/src/stores/employee/index.ts @@ -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,