feat: employee stats

This commit is contained in:
puriphatt 2024-06-12 09:57:34 +00:00
parent 0728f0a3ff
commit be92fd509a
2 changed files with 40 additions and 15 deletions

View file

@ -204,6 +204,29 @@ const useEmployeeStore = defineStore('api-employee', () => {
}
}
async function getStatsEmployee(
customerBranchId?: string,
flow?: {
sessionId: string;
refTransactionId: string;
transactionId: string;
},
) {
const res = await api.get(
`/employee/stats${customerBranchId ? '?customerBranchId=' + customerBranchId : ''}/`,
{
headers: {
'X-Session-Id': flow?.sessionId,
'X-Rtid': flow?.refTransactionId,
'X-Tid': flow?.transactionId,
},
},
);
if (res && res.status === 200) {
return res.data;
}
}
return {
data,
globalOption,
@ -216,6 +239,7 @@ const useEmployeeStore = defineStore('api-employee', () => {
fetchCheckup,
fetchWork,
fetchOther,
getStatsEmployee,
};
});