All changes i made

This commit is contained in:
Eudes Inácio
2023-02-27 09:34:36 +01:00
77 changed files with 8025 additions and 6717 deletions
@@ -17,6 +17,7 @@ import { OfflineManagerService } from 'src/app/services/offline-manager.service'
import { RouteService } from 'src/app/services/route.service';
import { Storage } from '@ionic/storage';
import config from 'capacitor.config';
import { HttpErrorHandle } from 'src/app/services/http-error-handle.service';
@Component({
selector: 'app-approve-event',
@@ -58,7 +59,8 @@ export class ApproveEventPage implements OnInit {
private backgroundservice: BackgroundService,
public ThemeService: ThemeService,
private offlineManager: OfflineManagerService,
private storage: Storage
private storage: Storage,
private httpErrorHandle: HttpErrorHandle
) {
this.activatedRoute.paramMap.subscribe(params => {
//
@@ -216,7 +218,11 @@ export class ApproveEventPage implements OnInit {
}
}, (error) => {
this.getProcessFromDB();
if(error.status == 0) {
this.getProcessFromDB();
} else {
this.httpErrorHandle.httpStatusHandle(error)
}
})
}
@@ -229,15 +235,10 @@ export class ApproveEventPage implements OnInit {
try {
await this.processes.PostTaskAction(body).toPromise()
this.goBack();
this.toastService._successMessage('Evento aprovado')
this.httpErrorHandle.httpsSucessMessagge('Evento aprovação')
} 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 aprovado')
}
this.httpErrorHandle.httpStatusHandle(error)
}
finally {
loader.remove()
@@ -280,15 +281,10 @@ export class ApproveEventPage implements OnInit {
this.offlineManager.storeRequestData('event-listRever', body);
});
this.toastService._successMessage('Evento enviado para revisão');
this.httpErrorHandle.httpsSucessMessagge('Rever')
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.httpErrorHandle.httpStatusHandle(error)
} finally {
loader.remove()
}
@@ -308,15 +304,10 @@ export class ApproveEventPage implements OnInit {
const loader = this.toastService.loading()
try {
await this.processes.PostTaskAction(body).toPromise();
await this.toastService._successMessage('Processo rejeitado');
this.httpErrorHandle.httpsSucessMessagge('Rejeitar')
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 rejeitado')
}
this.httpErrorHandle.httpStatusHandle(error)
}
finally {
loader.remove()