This commit is contained in:
tiago.kayaya
2021-09-03 13:11:53 +01:00
parent 3c7c60cce0
commit 1ab73f0daf
2 changed files with 8 additions and 13 deletions
@@ -382,19 +382,17 @@ export class ExpedienteDetailPage implements OnInit {
}); });
await modal.present(); await modal.present();
modal.onDidDismiss().then( async(res)=>{ modal.onDidDismiss().then( async(res)=>{
alert('AQUI')
let body = res['data']; let body = res['data'];
if(res['data']) { if(res['data']) {
//await this.distartExpedientModal(body);
const loader = this.toastService.loading() const loader = this.toastService.loading()
try { try {
await this.processes.CompleteTask(body).toPromise(); await this.processes.CompleteTask(body).toPromise();
//this.toastService.successMessage('Processo descartado'); this.goBack();
this.goBack(); } catch (error) {
} catch (error) { this.toastService.badRequest('Processo não descartado')
this.toastService.badRequest('Processo não descartado') } finally {
} finally { loader.remove()
loader.remove()
} }
} }
else{ else{
@@ -87,7 +87,7 @@ export class OptsExpedientePage implements OnInit {
} }
else { else {
this.location.back() this.location.back()
/* this.activatedRoute.paramMap.subscribe(params => { /* this.activatedRoute.paramMap.subscribe(params => {
console.log('YES'); console.log('YES');
@@ -166,7 +166,7 @@ export class OptsExpedientePage implements OnInit {
}); });
}); });
this.popoverController.dismiss() this.popoverController.dismiss()
} }
@@ -325,12 +325,9 @@ export class OptsExpedientePage implements OnInit {
console.log(res['data']); console.log(res['data']);
let body = res['data']; let body = res['data'];
if(res['data']){ if(res['data']){
console.log('open discart')
//this.distartExpedientModal(body);
const loader = this.toastService.loading() const loader = this.toastService.loading()
try { try {
await this.processes.CompleteTask(body).toPromise(); await this.processes.CompleteTask(body).toPromise();
this.toastService.successMessage('Processo descartado');
this.goBack(); this.goBack();
} catch (error) { } catch (error) {
this.toastService.badRequest('Processo não descartado') this.toastService.badRequest('Processo não descartado')