to many changes

This commit is contained in:
Eudes Inácio
2023-02-27 17:39:10 +01:00
parent fcd1989334
commit 46387d4977
30 changed files with 329 additions and 160 deletions
@@ -12,6 +12,7 @@ import { PedidoService } from 'src/app/Rules/pedido.service';
import { PermissionService } from 'src/app/services/permission.service';
import { NewGroupPage } from 'src/app/pages/chat/new-group/new-group.page';
import { ForwardPage } from 'src/app/modals/forward/forward.page';
import { HttpErrorHandle } from 'src/app/services/http-error-handle.service';
@Component({
@@ -37,6 +38,7 @@ export class RequestOptionsPage implements OnInit {
private toastService: ToastService,
public p: PermissionService,
private pedidoService: PedidoService,
private httpErrorHandle: HttpErrorHandle
) {
this.task = this.navParams.get('task');
this.fulltask = this.navParams.get('fulltask');
@@ -88,13 +90,13 @@ export class RequestOptionsPage implements OnInit {
const loader = this.toastService.loading()
this.processes.SetTaskToPending(this.task.SerialNumber).subscribe(res=>{
this.toastService._successMessage()
this.httpErrorHandle.httpsSucessMessagge('Enviar para Pendentes')
this.close();
loader.remove()
}, ()=> {
}, (error)=> {
loader.remove()
this.toastService._badRequest('Processo não encontrado')
this.httpErrorHandle.httpStatusHandle(error)
});
}
@@ -195,14 +197,9 @@ export class RequestOptionsPage implements OnInit {
try {
await this.processes.CompleteTask(body).toPromise()
this.close();
this.toastService._successMessage()
this.httpErrorHandle.httpsSucessMessagge('Solicitar Reapreciação')
} catch (error) {
if(error.status == 0) {
this.toastService._badRequest('Sem acesso à internet. Por favor verifique sua conexão')
} else {
this.toastService._badRequest()
}
this.httpErrorHandle.httpStatusHandle(error);
}
finally {
loader.remove()
@@ -270,14 +267,9 @@ export class RequestOptionsPage implements OnInit {
note
}).toPromise()
this.toastService._successMessage('Processo arquivado')
this.httpErrorHandle.httpsSucessMessagge('Arquivar')
} catch (error) {
if(error.status == 0) {
this.toastService._badRequest('Sem acesso à internet. Por favor verifique sua conexão')
} else {
this.toastService._badRequest('Processo não arquivado')
}
this.httpErrorHandle.httpStatusHandle(error)
} finally {
loader.remove()
}