mirror of
https://code.equilibrium.co.ao/ITO/doneit-web.git
synced 2026-04-20 21:35:50 +00:00
Improve loader
This commit is contained in:
+16
-1
@@ -102,6 +102,9 @@ export class ApproveEventModalPage implements OnInit {
|
||||
console.log('approveTask SERIALNUMBER: ', serialNumber)
|
||||
let body = { "serialNumber": serialNumber, "action": "Aprovar" }
|
||||
console.log(body);
|
||||
|
||||
const loader = this.toastService.loading()
|
||||
|
||||
try {
|
||||
await this.processes.PostTaskAction(body).toPromise()
|
||||
|
||||
@@ -112,6 +115,9 @@ export class ApproveEventModalPage implements OnInit {
|
||||
|
||||
} catch (error) {
|
||||
this.toastService.badRequest('Evento não aprovado')
|
||||
}
|
||||
finally {
|
||||
loader.remove()
|
||||
}
|
||||
|
||||
}
|
||||
@@ -128,6 +134,8 @@ export class ApproveEventModalPage implements OnInit {
|
||||
|
||||
let body = { "serialNumber": serialNumber, "action": "Rejeitar" }
|
||||
|
||||
const loader = this.toastService.loading()
|
||||
|
||||
try {
|
||||
await this.processes.PostTaskAction(body).toPromise()
|
||||
|
||||
@@ -136,6 +144,9 @@ export class ApproveEventModalPage implements OnInit {
|
||||
})
|
||||
} catch (error) {
|
||||
this.toastService.badRequest('Evento não rejeitado')
|
||||
}
|
||||
finally {
|
||||
loader.remove()
|
||||
}
|
||||
|
||||
this.modalController.dismiss(null);
|
||||
@@ -183,7 +194,8 @@ export class ApproveEventModalPage implements OnInit {
|
||||
}
|
||||
|
||||
//console.log(body);
|
||||
|
||||
const loader = this.toastService.loading()
|
||||
|
||||
try {
|
||||
await this.processes.PostTaskAction(body).toPromise()
|
||||
this.router.navigate(['/home/gabinete-digital/event-list']);
|
||||
@@ -191,6 +203,9 @@ export class ApproveEventModalPage implements OnInit {
|
||||
} catch (error) {
|
||||
this.toastService.badRequest()
|
||||
this.router.navigate(['/home/gabinete-digital/event-list']);
|
||||
}
|
||||
finally {
|
||||
loader.remove()
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
@@ -97,6 +97,8 @@ export class ApproveEventPage implements OnInit {
|
||||
let body = { "serialNumber": serialNumber, "action": "Aprovar" }
|
||||
console.log(body);
|
||||
|
||||
const loader = this.toastService.loading()
|
||||
|
||||
try {
|
||||
await this.processes.PostTaskAction(body).toPromise()
|
||||
this.toastService.successMessage();
|
||||
@@ -105,6 +107,9 @@ export class ApproveEventPage implements OnInit {
|
||||
} catch (error) {
|
||||
this.toastService.badRequest()
|
||||
}
|
||||
finally {
|
||||
loader.remove()
|
||||
}
|
||||
|
||||
|
||||
/* this.approveEventDismiss.emit({
|
||||
@@ -144,13 +149,18 @@ export class ApproveEventPage implements OnInit {
|
||||
}
|
||||
console.log(body);
|
||||
|
||||
const loader = this.toastService.loading()
|
||||
|
||||
try {
|
||||
await this.processes.PostTaskAction(body).toPromise();
|
||||
this.toastService.successMessage('Pedido enviado');
|
||||
this.goBack();
|
||||
} catch (error) {
|
||||
this.toastService.badRequest();
|
||||
} finally {
|
||||
loader.remove()
|
||||
}
|
||||
|
||||
}
|
||||
else{
|
||||
//this.alertService.presentAlert('Operação cancelada!');
|
||||
@@ -164,6 +174,7 @@ export class ApproveEventPage implements OnInit {
|
||||
async rejeitar(serialNumber:string){
|
||||
let body = { "serialNumber": serialNumber, "action": "Rejeitar" }
|
||||
console.log(body);
|
||||
const loader = this.toastService.loading()
|
||||
try {
|
||||
this.processes.PostTaskAction(body).toPromise();
|
||||
await this.toastService.successMessage('Processo rejeitado');
|
||||
@@ -171,9 +182,14 @@ export class ApproveEventPage implements OnInit {
|
||||
} catch (error) {
|
||||
this.toastService.badRequest()
|
||||
}
|
||||
finally {
|
||||
loader.remove()
|
||||
}
|
||||
}
|
||||
|
||||
async getAttachments(instanceId:string){
|
||||
const loader = this.toastService.loading()
|
||||
|
||||
try {
|
||||
this.loadedAttachments = await this.attachmentsService.getAttachmentsById(instanceId).toPromise();
|
||||
|
||||
@@ -233,13 +249,18 @@ export class ApproveEventPage implements OnInit {
|
||||
}
|
||||
console.log(body);
|
||||
|
||||
try {
|
||||
const loader = this.toastService.loading()
|
||||
|
||||
try {
|
||||
await this.processes.PostTaskAction(body).toPromise();
|
||||
this.toastService.successMessage();
|
||||
this.goBack();
|
||||
} catch (error) {
|
||||
this.toastService.badRequest();
|
||||
} finally {
|
||||
loader.remove()
|
||||
}
|
||||
|
||||
}
|
||||
else{
|
||||
//this.alertService.presentAlert('Operação cancelada!');
|
||||
|
||||
Reference in New Issue
Block a user