This commit is contained in:
tiago.kayaya
2021-10-15 15:21:26 +01:00
parent 887c9c2186
commit fcd518e8a3
5 changed files with 70 additions and 101 deletions
@@ -184,7 +184,7 @@ export class ExpedientTaskModalPage implements OnInit {
}
runValidation() {
this.validateFrom = true
this.validateFrom = true;
}
injectValidation() {
@@ -426,17 +426,22 @@ export class ExpedientTaskModalPage implements OnInit {
}
}
try {
this.taskResult = await this.despachoService.createDespacho(this.postData).toPromise();
await this.toastService.successMessage('Processo efetuado');
this.modalController.dismiss(action_despacho_pr);
} catch (error) {
await this.toastService.badRequest('Processo não efetuado')
} finally {
loader.remove()
}
if(this.postData.DispatchFolder.Message){
try {
this.taskResult = await this.despachoService.createDespacho(this.postData).toPromise();
await this.toastService.successMessage('Processo efetuado');
this.modalController.dismiss(action_despacho_pr);
} catch (error) {
console.log('this.taskResult', this.taskResult);
await this.toastService.badRequest('Processo não efetuado')
} finally {
//loader.remove()
}
}
else{
this.toastService.badRequest('Por favor adicione uma nota');
}
loader.remove();
break;
case '1': // parecer
@@ -459,24 +464,16 @@ export class ExpedientTaskModalPage implements OnInit {
}
}
if(this.postData.DispatchFolder.Message){
try {
try {
this.taskResult = await this.processes.postParecerPr(this.postData).toPromise();
await this.toastService.successMessage('Pedido enviado');
this.modalController.dismiss(action_parecer_pr);
} catch (error) {
this.taskResult = await this.processes.postParecerPr(this.postData).toPromise();
await this.toastService.successMessage('Pedido enviado');
this.modalController.dismiss(action_parecer_pr);
} catch (error) {
await this.toastService.badRequest('Processo não efetuado')
} finally {
//loader.remove()
}
await this.toastService.badRequest('Processo não efetuado')
} finally {
loader.remove()
}
else{
this.toastService.badRequest('Por favor adicione uma nota');
}
loader.remove();
break;
}