This commit is contained in:
Peter Maquiran
2023-02-17 15:23:43 +01:00
parent 7d79128ffd
commit 83be7ac807
23 changed files with 227 additions and 189 deletions
@@ -187,37 +187,44 @@ export class ApproveEventPage implements OnInit {
modal.onDidDismiss()
.then( async (res) => {
if(res.data.note !== '') {
let body = { "serialNumber": serialNumber,
"action": "Emendar",
"dataFields": {
"ReviewUserComment": res.data,
}
}
const loader = this.toastService.loading();
try {
await this.processes.PostTaskAction(body).toPromise();
this.toastService._successMessage('Evento enviado para revisão');
this.close();
} catch (error) {
if(error.status == 0) {
this.toastService._badRequest('Sem acesso à internet. Por favor verifique sua conexão')
} else {
this.toastService._badRequest('Evento não enviado para revisão');
if(res.data.option == 'save') {
if(res.data.note !== '') {
let body = { "serialNumber": serialNumber,
"action": "Emendar",
"dataFields": {
"ReviewUserComment": res.data,
}
}
const loader = this.toastService.loading();
try {
await this.processes.PostTaskAction(body).toPromise();
this.toastService._successMessage('Evento enviado para revisão');
this.close();
} catch (error) {
if(error.status == 0) {
this.toastService._badRequest('Sem acesso à internet. Por favor verifique sua conexão')
} else {
this.toastService._badRequest('Evento não enviado para revisão');
}
} finally {
loader.remove()
}
} finally {
loader.remove()
}
}
else {
if(res.data.option == 'save') {
this.toastService._badRequest('É necessário adicionar uma nota');
else {
if(res.data.option == 'save') {
this.toastService._badRequest('É necessário adicionar uma nota');
}
}
} else {
}
});
}