diff --git a/src/app/profile/dashboard/orientation-details/orientation-details.component.html b/src/app/profile/dashboard/orientation-details/orientation-details.component.html index b3689bb4a1d030a310240635eb8eaf79ccefc19e..43306c2db07d3ceb1154defb8dac8c281a56c924 100644 --- a/src/app/profile/dashboard/orientation-details/orientation-details.component.html +++ b/src/app/profile/dashboard/orientation-details/orientation-details.component.html @@ -269,7 +269,7 @@ [opened]="isModalOpenned" [title]="'Clôturer un accompagnement'" [validateDisabled]="isValidateDisabled" - (closed)="closeOrientation($event)" + (closed)="closeOrientation($event, isClosed)" > <div class="modalContent emphasized"> {{ orientation.personOriented.name }} {{ orientation.personOriented.surname | uppercase }} @@ -287,7 +287,7 @@ <div> <label for="comment">Commentaires <span class="optional">(facultatifs)</span></label> - <app-textarea #comment id="comment" [value]="orientation.closingComment" /> + <app-textarea #comment id="comment" [value]="orientation.processingComment" /> </div> </div> </app-modal> diff --git a/src/app/profile/dashboard/orientation-details/orientation-details.component.ts b/src/app/profile/dashboard/orientation-details/orientation-details.component.ts index 80d44145bac4bf58aba4110ef211377a397777d2..0b4e0a956bc256984a77a10f9eff29d6e727fea4 100644 --- a/src/app/profile/dashboard/orientation-details/orientation-details.component.ts +++ b/src/app/profile/dashboard/orientation-details/orientation-details.component.ts @@ -27,7 +27,7 @@ export class OrientationDetailsComponent implements OnInit { public isModalOpenned = false; public userProfile: User; public from: string; - public closingComment = ''; + public processingComment = ''; public selectedStatus = ''; public isClosed: boolean; @@ -61,15 +61,15 @@ export class OrientationDetailsComponent implements OnInit { this.isModalOpenned = true; } - public closeOrientation(event): void { + public closeOrientation(event, isClosed): void { if (event) { const comment = this.commentTextarea?.value || ''; const sanitizedComment = this.sanitizer.sanitize(SecurityContext.HTML, comment); this.patchOrientation({ status: this.selectedStatus, action: null, - closingComment: sanitizedComment, - closingDate: new Date(), + processing: sanitizedComment, + closingDate: isClosed ? null : new Date(), modifiedBy: this.userProfile._id, }); }