Evento to approve

This commit is contained in:
Peter Maquiran
2023-02-06 10:49:58 +01:00
parent 0bcf19ab25
commit 79b8b28ce4
2 changed files with 34 additions and 14 deletions
@@ -57,11 +57,15 @@ export class EventActionsPopoverPage implements OnInit {
try {
await this.processes.PostTaskAction(body).toPromise()
this.toastService.successMessage();
this.toastService._successMessage('Evento aprovar')
this.goBack();
} catch (error) {
this.toastService.badRequest()
if(error.status == 0) {
this.toastService._badRequest('Sem acesso à internet. Por favor verifique sua conexão')
} else {
this.toastService._badRequest('Evento não aprovar')
}
}
finally {
loader.remove()
@@ -77,11 +81,15 @@ export class EventActionsPopoverPage implements OnInit {
try {
await this.processes.PostTaskAction(body).toPromise()
this.toastService.successMessage();
this.toastService._successMessage('Evento enviado para revisão');
this.goBack();
} catch (error) {
this.toastService.badRequest()
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()
@@ -119,9 +127,16 @@ export class EventActionsPopoverPage implements OnInit {
try {
await this.processes.PostTaskAction(body).toPromise();
this.toastService._successMessage('Evento enviado para revisão');
this.toastService.successMessage('Pedido enviado');
this.goBack();
} 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');
}
this.toastService.badRequest();
}
finally {
@@ -140,10 +155,15 @@ export class EventActionsPopoverPage implements OnInit {
const loader = this.toastService.loading();
try {
await this.processes.PostTaskAction(body).toPromise();
await this.toastService.successMessage('Processo rejeitado');
this.toastService._successMessage('Evento rejeitado')
this.goBack();
} catch (error) {
this.toastService.badRequest();
if(error.status == 0) {
this.toastService._badRequest('Sem acesso à internet. Por favor verifique sua conexão')
} else {
this.toastService._badRequest('Evento não rejeitado')
}
}
finally {
loader.remove();