Improve loader

This commit is contained in:
Peter Maquiran
2021-07-12 11:13:29 +01:00
parent c526426aec
commit 507ebd691a
34 changed files with 400 additions and 32 deletions
@@ -60,13 +60,20 @@ export class EventActionsPopoverPage implements OnInit {
let body = { "serialNumber": this.serialNumber, "action": "Aprovar" }
console.log(body);
const loader = this.toastService.loading()
try {
this.processes.PostTaskAction(body).toPromise()
this.toastService.successMessage();
this.goBack();
} catch (error) {
this.toastService.badRequest()
}
finally {
loader.remove()
}
}
async emendarTask() {
@@ -95,6 +102,8 @@ export class EventActionsPopoverPage implements OnInit {
}
console.log(body);
const loader = this.toastService.loading()
try {
await this.processes.PostTaskAction(body).toPromise();
this.toastService.successMessage('Pedido enviado');
@@ -102,6 +111,9 @@ export class EventActionsPopoverPage implements OnInit {
} catch (error) {
this.toastService.badRequest();
}
finally {
loader.remove()
}
}
else{
//this.alertService.presentAlert('Operação cancelada!');
@@ -112,13 +124,21 @@ export class EventActionsPopoverPage implements OnInit {
async rejeitar(){
let body = { "serialNumber": this.serialNumber, "action": "Rejeitar" }
console.log(body);
const loader = this.toastService.loading()
try {
this.processes.PostTaskAction(body).toPromise();
await this.toastService.successMessage('Processo rejeitado');
this
this.goBack();
} catch (error) {
this.toastService.badRequest()
}
finally {
loader.remove()
}
}
async editTask() {