Fixe merge and improve sucess message

This commit is contained in:
Peter Maquiran
2021-05-28 15:45:41 +01:00
21 changed files with 322 additions and 87 deletions
@@ -84,7 +84,7 @@ export class ApproveEventComponent implements OnInit {
console.log(body);
try {
this.processes.PostTaskAction(body).toPromise()
await this.processes.PostTaskAction(body).toPromise()
this.modalController.dismiss(serialNumber);
this.successMessage()
} catch (error) {
@@ -115,7 +115,7 @@ export class ApproveEventComponent implements OnInit {
}
async rejectTask(serialNumber:string){
async rejectTask(serialNumber:string) {
let body = { "serialNumber": serialNumber, "action": "Rejeitar" }
console.log(body);
@@ -167,11 +167,11 @@ export class ApproveEventComponent implements OnInit {
},
cssClass: 'emend-message-modal',
backdropDismiss: false
});
});-
await modal.present();
modal.onDidDismiss().then(res => {
modal.onDidDismiss().then( async (res) => {
console.log(res.data);
if(res.data !== ''){
@@ -182,9 +182,18 @@ export class ApproveEventComponent implements OnInit {
}
}
console.log(body);
this.processes.PostTaskAction(body).toPromise()
//this.router.navigate(['/home/gabinete-digital/event-list']);
this.goToEventsToApprove();
try {
await this.processes.PostTaskAction(body).toPromise()
//this.router.navigate(['/home/gabinete-digital/event-list']);
this.goToEventsToApprove();
this.successMessage()
} catch (error) {
this.badRequest()
}
}
else{
//this.alertService.presentAlert('Operação cancelada!');
@@ -169,7 +169,7 @@ export class NewEventPage implements OnInit {
if(this.profile=='mdgpr') {
this.eventService.postEventMd(this.postEvent, this.postEvent.CalendarName).subscribe(
(id) => {
async (id) => {
const eventId: string = id;
@@ -186,7 +186,7 @@ export class NewEventPage implements OnInit {
};
});
DocumentToSave.forEach((attachments, i) => {
await DocumentToSave.forEach((attachments, i) => {
this.attachmentsService.setEventAttachmentById(attachments).subscribe((res) =>{
if(DocumentToSave.length == (i+1)){