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 7673762e6..bf0907324 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 @@ -1,6 +1,6 @@ -import { inject, Injectable } from '@angular/core'; +import { Injectable } from '@angular/core'; import { IqserDialog } from '@common-ui/dialog/iqser-dialog.service'; -import { getConfig, Toaster } from '@iqser/common-ui'; +import { getConfig } from '@iqser/common-ui'; import { List, log } from '@iqser/common-ui/lib/utils'; import { AnnotationPermissions } from '@models/file/annotation.permissions'; import { AnnotationWrapper } from '@models/file/annotation.wrapper'; @@ -13,7 +13,6 @@ import { IRectangle, IResizeRequest, } from '@red/domain'; -import { CommentsApiService } from '@services/comments-api.service'; import { DossierTemplatesService } from '@services/dossier-templates/dossier-templates.service'; import { PermissionsService } from '@services/permissions.service'; import { firstValueFrom, Observable } from 'rxjs'; @@ -48,7 +47,6 @@ import { SkippedService } from './skipped.service'; @Injectable() export class AnnotationActionsService { readonly #isDocumine = getConfig().IS_DOCUMINE; - readonly #commentsApiService = inject(CommentsApiService); constructor( private readonly _manualRedactionService: ManualRedactionService, @@ -63,7 +61,6 @@ export class AnnotationActionsService { private readonly _skippedService: SkippedService, private readonly _dossierTemplatesService: DossierTemplatesService, private readonly _permissionsService: PermissionsService, - private readonly _toaster: Toaster, ) {} removeHighlights(highlights: AnnotationWrapper[]): void { @@ -107,7 +104,11 @@ export class AnnotationActionsService { } const recategorizeBody: List = annotations.map(annotation => { - const body = { annotationId: annotation.id, type: result.type ?? annotation.type }; + const body: IRecategorizationRequest = { + annotationId: annotation.id, + type: result.type ?? annotation.type, + comment: result.comment, + }; if (!this.#isDocumine) { return { ...body, @@ -130,16 +131,6 @@ export class AnnotationActionsService { ) .pipe(log()), ); - - if (result.comment) { - try { - for (const a of annotations) { - await this.#commentsApiService.add(result.comment, a.id, dossierId, fileId); - } - } catch (error) { - this._toaster.rawError(error.error.message); - } - } } async removeRedaction(redactions: AnnotationWrapper[], permissions: AnnotationPermissions) {