diff --git a/apps/red-ui/src/app/modules/dossier/dialogs/edit-dossier-dialog/deleted-documents/edit-dossier-deleted-documents.component.ts b/apps/red-ui/src/app/modules/dossier/dialogs/edit-dossier-dialog/deleted-documents/edit-dossier-deleted-documents.component.ts index 093df3085..8794c15a5 100644 --- a/apps/red-ui/src/app/modules/dossier/dialogs/edit-dossier-dialog/deleted-documents/edit-dossier-deleted-documents.component.ts +++ b/apps/red-ui/src/app/modules/dossier/dialogs/edit-dossier-dialog/deleted-documents/edit-dossier-deleted-documents.component.ts @@ -87,9 +87,9 @@ export class EditDossierDeletedDocumentsComponent extends ListingComponent f.fileId); - await this._fileManagementController.hardDeleteFile(fileIds, this.dossierWrapper.dossierId).toPromise(); + await this._fileManagementController.hardDeleteFile(this.dossierWrapper.dossierId, fileIds).toPromise(); this._removeFromList(fileIds); this.updateDossier.emit(); } diff --git a/libs/common-ui b/libs/common-ui index 360ef9bd6..89376a655 160000 --- a/libs/common-ui +++ b/libs/common-ui @@ -1 +1 @@ -Subproject commit 360ef9bd6c87ec2ebb22554253e9ce9390775f09 +Subproject commit 89376a65544fcdfcab1d960fba0d9f580cddc1ca diff --git a/libs/red-ui-http/src/lib/api/fileManagementController.service.ts b/libs/red-ui-http/src/lib/api/fileManagementController.service.ts index 19ba3aa4c..e42afb52d 100644 --- a/libs/red-ui-http/src/lib/api/fileManagementController.service.ts +++ b/libs/red-ui-http/src/lib/api/fileManagementController.service.ts @@ -325,31 +325,45 @@ export class FileManagementControllerService { /** * Hard deletes an uploaded file. * None - * @param body fileId * @param dossierId dossierId + * @param fileIds fileIds * @param observe set whether or not to return the data Observable as the body, response or events. defaults to returning the body. * @param reportProgress flag to report request and response progress. */ - public hardDeleteFile(body: Array, dossierId: string, observe?: 'body', reportProgress?: boolean): Observable; - + public hardDeleteFile(dossierId: string, fileIds: Array, observe?: 'body', reportProgress?: boolean): Observable; public hardDeleteFile( - body: Array, dossierId: string, + fileIds: Array, observe?: 'response', reportProgress?: boolean ): Observable>; - - public hardDeleteFile(body: Array, dossierId: string, observe?: 'events', reportProgress?: boolean): Observable>; - - public hardDeleteFile(body: Array, dossierId: string, observe: any = 'body', reportProgress: boolean = false): Observable { - if (body === null || body === undefined) { - throw new Error('Required parameter body was null or undefined when calling hardDeleteFile.'); - } - + public hardDeleteFile( + dossierId: string, + fileIds: Array, + observe?: 'events', + reportProgress?: boolean + ): Observable>; + public hardDeleteFile( + dossierId: string, + fileIds: Array, + observe: any = 'body', + reportProgress: boolean = false + ): Observable { if (dossierId === null || dossierId === undefined) { throw new Error('Required parameter dossierId was null or undefined when calling hardDeleteFile.'); } + if (fileIds === null || fileIds === undefined) { + throw new Error('Required parameter fileIds was null or undefined when calling hardDeleteFile.'); + } + + let queryParameters = new HttpParams({ encoder: new CustomHttpUrlEncodingCodec() }); + if (fileIds) { + fileIds.forEach(element => { + queryParameters = queryParameters.append('fileIds', element); + }); + } + let headers = this.defaultHeaders; // authentication (RED-OAUTH) required @@ -366,15 +380,8 @@ export class FileManagementControllerService { headers = headers.set('Accept', httpHeaderAcceptSelected); } - // to determine the Content-Type header - const consumes: string[] = ['*/*']; - const httpContentTypeSelected: string | undefined = this.configuration.selectHeaderContentType(consumes); - if (httpContentTypeSelected !== undefined) { - headers = headers.set('Content-Type', httpContentTypeSelected); - } - return this.httpClient.request('delete', `${this.basePath}/delete/hard-delete/${encodeURIComponent(String(dossierId))}`, { - body: body, + params: queryParameters, withCredentials: this.configuration.withCredentials, headers: headers, observe: observe,