mirror of
https://code.equilibrium.co.ao/ITO/doneit-web.git
synced 2026-04-19 13:02:56 +00:00
Improve loader
This commit is contained in:
@@ -81,12 +81,16 @@ export class ApproveEventPage implements OnInit {
|
||||
async approveTask(serialNumber:string) {
|
||||
let body = { "serialNumber": serialNumber, "action": "Aprovar" }
|
||||
|
||||
const loader = this.toastService.loading()
|
||||
|
||||
try {
|
||||
await this.processes.PostTaskAction(body).toPromise()
|
||||
this.modalController.dismiss(serialNumber);
|
||||
this.toastService.successMessage()
|
||||
} catch (error) {
|
||||
this.toastService.badRequest()
|
||||
} finally {
|
||||
loader.remove()
|
||||
}
|
||||
|
||||
/* this.approveEventDismiss.emit({
|
||||
@@ -105,12 +109,16 @@ export class ApproveEventPage implements OnInit {
|
||||
let body = { "serialNumber": serialNumber, "action": "Rejeitar" }
|
||||
console.log(body);
|
||||
|
||||
const loader = this.toastService.loading()
|
||||
|
||||
try {
|
||||
await this.processes.PostTaskAction(body).toPromise()
|
||||
this.router.navigate(['/home/gabinete-digital/event-list']);
|
||||
this.toastService.successMessage('Evento rejeitado')
|
||||
} catch (error) {
|
||||
this.toastService.badRequest('Processo não efectuado')
|
||||
} finally {
|
||||
loader.remove()
|
||||
}
|
||||
|
||||
}
|
||||
@@ -165,6 +173,7 @@ export class ApproveEventPage implements OnInit {
|
||||
}
|
||||
}
|
||||
console.log(body);
|
||||
const loader = this.toastService.loading()
|
||||
|
||||
try {
|
||||
await this.processes.PostTaskAction(body).toPromise();
|
||||
@@ -172,6 +181,8 @@ export class ApproveEventPage implements OnInit {
|
||||
this.close();
|
||||
} catch (error) {
|
||||
this.toastService.badRequest();
|
||||
} finally {
|
||||
loader.remove()
|
||||
}
|
||||
}
|
||||
else{
|
||||
|
||||
Reference in New Issue
Block a user