mirror of
https://gitlab.com/mbugroup/lti-web-client.git
synced 2026-05-23 06:45:46 +00:00
feat: implement bulk approval in expense
This commit is contained in:
@@ -330,6 +330,41 @@ export class ExpenseApiService extends BaseApiService<
|
||||
}
|
||||
}
|
||||
|
||||
async bulkApprovals(
|
||||
ids: number[],
|
||||
status:
|
||||
| 'HEAD_AREA'
|
||||
| 'UNIT_VICE_PRESIDENT'
|
||||
| 'FINANCE'
|
||||
| 'REALISASI'
|
||||
| 'SELESAI',
|
||||
date: string, // YYYY-MM-DD
|
||||
notes: string
|
||||
): Promise<BaseApiResponse<Expense> | undefined> {
|
||||
try {
|
||||
const bulkApproveRes = await httpClient<BaseApiResponse<Expense>>(
|
||||
`${this.basePath}/approvals/bulk`,
|
||||
{
|
||||
method: 'POST',
|
||||
body: {
|
||||
approvable_ids: ids,
|
||||
status: status,
|
||||
date: date,
|
||||
notes: notes,
|
||||
},
|
||||
}
|
||||
);
|
||||
|
||||
return bulkApproveRes;
|
||||
} catch (error) {
|
||||
if (axios.isAxiosError<BaseApiResponse<Expense>>(error)) {
|
||||
return error.response?.data;
|
||||
}
|
||||
|
||||
return undefined;
|
||||
}
|
||||
}
|
||||
|
||||
async rejectHeadArea(
|
||||
id: number,
|
||||
notes?: string
|
||||
|
||||
Reference in New Issue
Block a user