mirror of
https://code.equilibrium.co.ao/ITO/doneit-web.git
synced 2026-04-18 12:37:53 +00:00
All changes i made
This commit is contained in:
+9
-27
@@ -35,6 +35,7 @@ import { Storage } from '@ionic/storage';
|
||||
import { LoginUserRespose } from 'src/app/models/user.model';
|
||||
import { AuthService } from 'src/app/services/auth.service';
|
||||
import { SessionStore } from 'src/app/store/session.service';
|
||||
import { HttpErrorHandle } from 'src/app/services/http-error-handle.service';
|
||||
|
||||
@Component({
|
||||
selector: 'app-expediente-detail',
|
||||
@@ -88,6 +89,7 @@ export class ExpedienteDetailPage implements OnInit {
|
||||
private dataService: DataService,
|
||||
private storage: Storage,
|
||||
private userAuth: AuthService,
|
||||
private httpErroHandle: HttpErrorHandle
|
||||
) {
|
||||
this.loggeduser = SessionStore.user
|
||||
console.log('SessionStore', SessionStore)
|
||||
@@ -242,14 +244,9 @@ export class ExpedienteDetailPage implements OnInit {
|
||||
try {
|
||||
await this.processes.CompleteTask(body).toPromise();
|
||||
this.close();
|
||||
this.toastService._successMessage('Processo aprovado')
|
||||
this.httpErroHandle.httpsSucessMessagge('Avaliação Superiror')
|
||||
} 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 aprovado')
|
||||
}
|
||||
this.httpErroHandle.httpStatusHandle(error)
|
||||
} finally {
|
||||
loader.remove()
|
||||
}
|
||||
@@ -272,14 +269,9 @@ export class ExpedienteDetailPage implements OnInit {
|
||||
try {
|
||||
await this.processes.CompleteTask(body).toPromise()
|
||||
this.close();
|
||||
this.toastService._successMessage()
|
||||
this.httpErroHandle.httpsSucessMessagge('Rever')
|
||||
} catch (error) {
|
||||
if(error.status == 0) {
|
||||
this.toastService._badRequest('Sem acesso à internet. Por favor verifique sua conexão')
|
||||
} else {
|
||||
|
||||
this.toastService._badRequest()
|
||||
}
|
||||
this.httpErroHandle.httpStatusHandle(error)
|
||||
} finally {
|
||||
loader.remove()
|
||||
}
|
||||
@@ -402,17 +394,12 @@ export class ExpedienteDetailPage implements OnInit {
|
||||
this.getFromDB();
|
||||
} else {
|
||||
try {
|
||||
this.toastService._badRequest('Processo não encontrado')
|
||||
this.httpErroHandle.httpStatusHandle(error)
|
||||
this.goBack()
|
||||
} catch (e) {
|
||||
window.history.back();
|
||||
}
|
||||
if(error.status == 0) {
|
||||
this.toastService._badRequest('Sem acesso à internet. Por favor verifique sua conexão')
|
||||
} else {
|
||||
|
||||
this.toastService._badRequest('Processo não encontrado')
|
||||
}
|
||||
this.httpErroHandle.httpStatusHandle(error)
|
||||
}
|
||||
});
|
||||
|
||||
@@ -545,12 +532,7 @@ export class ExpedienteDetailPage implements OnInit {
|
||||
await this.processes.CompleteTask(body).toPromise();
|
||||
this.goBack();
|
||||
} 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 descartado')
|
||||
}
|
||||
this.httpErroHandle.httpStatusHandle(error)
|
||||
} finally {
|
||||
loader.remove()
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user