From 86eeab5e69413e097854343a614d7089ceb08ed3 Mon Sep 17 00:00:00 2001 From: Valentin Mihai Date: Tue, 26 Nov 2024 12:44:24 +0200 Subject: [PATCH] RED-10373 - fixed bulk remove for multiple text redactions by splitting them into multiple requests as bulk endpoint do not support a list of redactions --- .../file-preview/services/annotation-actions.service.ts | 9 ++++----- 1 file changed, 4 insertions(+), 5 deletions(-) diff --git a/apps/red-ui/src/app/modules/file-preview/services/annotation-actions.service.ts b/apps/red-ui/src/app/modules/file-preview/services/annotation-actions.service.ts index 8df5c15c7..e94a33190 100644 --- a/apps/red-ui/src/app/modules/file-preview/services/annotation-actions.service.ts +++ b/apps/red-ui/src/app/modules/file-preview/services/annotation-actions.service.ts @@ -504,7 +504,7 @@ export class AnnotationActionsService { return; } - if (redactions[0].AREA && bulkLocal) { + if (bulkLocal) { const promises = []; for (const request of body) { promises.push( @@ -587,10 +587,9 @@ export class AnnotationActionsService { dialogResult: RemoveRedactionResult, ): List { if (dialogResult.bulkLocal || !!dialogResult.pageNumbers.length) { - const redaction = redactions[0]; - return dialogResult.positions.map(position => ({ - value: redaction.value, - rectangle: redaction.AREA, + return dialogResult.positions.map((position, index) => ({ + value: redactions[index].value, + rectangle: redactions[index].AREA, pageNumbers: dialogResult.pageNumbers, position: position, comment: dialogResult.comment,