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