mirror of
https://gitlab.com/mbugroup/lti-web-client.git
synced 2026-05-21 05:45:46 +00:00
feat(FE-438): Add bulk approve/reject/delete and FAB
This commit is contained in:
@@ -61,6 +61,56 @@ export class UniformityApiService extends BaseApiService<
|
||||
}
|
||||
);
|
||||
}
|
||||
|
||||
async approve(
|
||||
idOrIds: number | number[],
|
||||
notes?: string
|
||||
): Promise<BaseApiResponse<Uniformity[]> | undefined> {
|
||||
const approvable_ids = Array.isArray(idOrIds) ? idOrIds : [idOrIds];
|
||||
return await this.customRequest<BaseApiResponse<Uniformity[]>>(
|
||||
'approvals',
|
||||
{
|
||||
method: 'POST',
|
||||
payload: {
|
||||
action: 'APPROVED',
|
||||
approvable_ids,
|
||||
notes,
|
||||
},
|
||||
}
|
||||
);
|
||||
}
|
||||
|
||||
async reject(
|
||||
idOrIds: number | number[],
|
||||
notes: string = ''
|
||||
): Promise<BaseApiResponse<Uniformity[]> | undefined> {
|
||||
const approvable_ids = Array.isArray(idOrIds) ? idOrIds : [idOrIds];
|
||||
return await this.customRequest<BaseApiResponse<Uniformity[]>>(
|
||||
'approvals',
|
||||
{
|
||||
method: 'POST',
|
||||
payload: {
|
||||
action: 'REJECTED',
|
||||
approvable_ids,
|
||||
notes,
|
||||
},
|
||||
}
|
||||
);
|
||||
}
|
||||
|
||||
async bulkDelete(
|
||||
ids: number[]
|
||||
): Promise<BaseApiResponse<Uniformity[]> | undefined> {
|
||||
return await this.customRequest<BaseApiResponse<Uniformity[]>>(
|
||||
'bulk-delete',
|
||||
{
|
||||
method: 'POST',
|
||||
payload: {
|
||||
ids,
|
||||
},
|
||||
}
|
||||
);
|
||||
}
|
||||
}
|
||||
|
||||
export const UniformityApi = new UniformityApiService(
|
||||
|
||||
Reference in New Issue
Block a user