RED-10453 - reload file or files (bulk case) after approval request

This commit is contained in:
Valentin Mihai 2024-11-13 11:28:41 +02:00
parent acf4a4f4d7
commit fb9242f637
2 changed files with 6 additions and 2 deletions

View File

@ -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)

View File

@ -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'),