mirror of
https://code.equilibrium.co.ao/ITO/doneit-web.git
synced 2026-04-21 05:45:50 +00:00
All changes i made
This commit is contained in:
@@ -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()
|
||||
|
||||
Reference in New Issue
Block a user