This commit is contained in:
Peter Maquiran
2021-07-26 15:19:03 +01:00
parent 3f007be25e
commit 85f6df2f0e
16 changed files with 852 additions and 197 deletions
@@ -247,14 +247,14 @@ export class EditEventToApprovePage implements OnInit {
// Validators.required
// ]),
participantes: new FormControl(this.taskParticipants, [
Validators.required
// Validators.required
]),
})
}
save() {
async save() {
this.injectValidation()
this.runValidation()
@@ -263,6 +263,8 @@ export class EditEventToApprovePage implements OnInit {
// set dates to eventProcess object
this.getDatepickerData()
this.taskParticipantsCc.forEach( e => {
e.IsRequired = false
})
@@ -300,24 +302,28 @@ export class EditEventToApprovePage implements OnInit {
console.log(event);
this.eventsService.postEventToApproveEdit(event).subscribe(()=>{
try {
await this.eventsService.postEventToApproveEdit(event).toPromise()
this.close()
this.toastService.successMessage('Evento editado');
}, error =>{
this.toastService.badRequest('Evento não editado');
})
} catch(e) {
this.toastService.badRequest('Evento não editado');
}
this.loadedAttachments.forEach((document:any)=>{
if(document['action'] == 'add') {
delete document.action
this.attachmentsService.setEventAttachmentById(document).subscribe(()=>{
this.toastService.successMessage();
// this.toastService.successMessage();
}, error =>{
this.toastService.badRequest();
});
} else if(document['action'] == 'delete') {
delete document.action
this.attachmentsService.deleteEventAttachmentById(document.Id).subscribe( res=>{
this.toastService.successMessage()
// this.toastService.successMessage()
}, error =>{
this.toastService.badRequest()
})
@@ -325,8 +331,6 @@ export class EditEventToApprovePage implements OnInit {
})
this.modalController.dismiss();
}
// setIntervenient(data){