RED-10453 - reload file or files (bulk case) after approval request
This commit is contained in:
parent
acf4a4f4d7
commit
fb9242f637
@ -113,11 +113,13 @@ export class BulkActionsService {
|
||||
async approve(files: File[]): Promise<void> {
|
||||
this._loadingService.start();
|
||||
const approvalResponse: ApproveResponse[] = await this._filesService.getApproveWarnings(files);
|
||||
this._loadingService.stop();
|
||||
const hasWarnings = approvalResponse.some(response => response.hasWarnings);
|
||||
if (!hasWarnings) {
|
||||
await firstValueFrom(this._filesService.loadAll(files[0].dossierId));
|
||||
this._loadingService.stop();
|
||||
return;
|
||||
}
|
||||
this._loadingService.stop();
|
||||
|
||||
const fileWarnings = approvalResponse
|
||||
.filter(response => response.hasWarnings)
|
||||
|
||||
@ -320,10 +320,12 @@ export class FileActionsComponent implements OnChanges {
|
||||
async setFileApproved() {
|
||||
this._loadingService.start();
|
||||
const approvalResponse: ApproveResponse = (await this._filesService.getApproveWarnings([this.file]))[0];
|
||||
this._loadingService.stop();
|
||||
if (!approvalResponse.hasWarnings) {
|
||||
await this._filesService.reload(this.file.dossierId, this.file);
|
||||
this._loadingService.stop();
|
||||
return;
|
||||
}
|
||||
this._loadingService.stop();
|
||||
|
||||
const data: IConfirmationDialogData = {
|
||||
title: _('confirmation-dialog.approve-file.title'),
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user