mirror of
https://code.equilibrium.co.ao/ITO/doneit-web.git
synced 2026-04-18 20:47:54 +00:00
Improve
This commit is contained in:
@@ -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){
|
||||
|
||||
Reference in New Issue
Block a user