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
@@ -168,6 +168,9 @@ export class DiplomaPage implements OnInit {
},
"AttachmentList" :documents,
}
const loader = this.toastService.loading()
try {
await this.processes.CompleteTask(body).toPromise()
@@ -178,6 +181,9 @@ export class DiplomaPage implements OnInit {
} catch (error) {
this.toastService.badRequest()
}
finally {
loader.remove()
}
}
async askToChange(note:string, documents:any){
@@ -191,12 +197,17 @@ export class DiplomaPage implements OnInit {
"AttachmentList" :documents,
}
const loader = this.toastService.loading()
try {
await this.processes.CompleteTask(body).toPromise()
this.toastService.successMessage()
} catch (error) {
this.toastService.badRequest()
}
finally {
loader.remove()
}
}
async finish(note:string, documents:any){
@@ -210,12 +221,18 @@ export class DiplomaPage implements OnInit {
},
"AttachmentList" :documents,
}
const loader = this.toastService.loading()
try {
await this.processes.CompleteTask(body).toPromise();
this.toastService.successMessage('Processo concluído')
} catch (error) {
this.toastService.badRequest()
}
finally {
loader.remove()
}
}