From 974757679a028bd4cb6bde35ce6b8d988118d4f5 Mon Sep 17 00:00:00 2001 From: Alex ORLUC <alex.orluc@maarch.org> Date: Tue, 13 Oct 2020 10:21:49 +0200 Subject: [PATCH] FEAT #15049 TIME 0:10 add data for executeAction --- .../send-to-record-management.component.ts | 12 ++++++++++-- 1 file changed, 10 insertions(+), 2 deletions(-) diff --git a/src/frontend/app/actions/send-to-record-management-action/send-to-record-management.component.ts b/src/frontend/app/actions/send-to-record-management-action/send-to-record-management.component.ts index a4249235353..2d21f05590c 100644 --- a/src/frontend/app/actions/send-to-record-management-action/send-to-record-management.component.ts +++ b/src/frontend/app/actions/send-to-record-management-action/send-to-record-management.component.ts @@ -130,7 +130,7 @@ export class SendToRecordManagementComponent implements OnInit { onSubmit() { this.loading = true; - + this.formatData(); if (this.data.resIds.length > 0) { this.executeAction(); } @@ -139,7 +139,7 @@ export class SendToRecordManagementComponent implements OnInit { executeAction() { const realResSelected: number[] = this.data.resIds; - this.http.put(this.data.processActionRoute, { resources: realResSelected, data: {} }).pipe( + this.http.put(this.data.processActionRoute, { resources: realResSelected, data: this.formatData() }).pipe( tap((data: any) => { if (!data) { this.dialogRef.close('success'); @@ -156,6 +156,14 @@ export class SendToRecordManagementComponent implements OnInit { ).subscribe(); } + formatData() { + const dataToSend = {}; + Object.keys(this.actionFormGroup.controls).forEach(element => { + dataToSend[element] = this.actionFormGroup.controls[element].value; + }); + return dataToSend; + } + archivalAgreementSelected(ev: any) { const archivalAgreement = this.archivalAgreements.filter((element: any) => element.id === ev.value); this.actionFormGroup.patchValue({entityArchiveRecipient: archivalAgreement[0].archiveEntityRegNumber}); -- GitLab