add notification message

This commit is contained in:
Peter Maquiran
2023-02-02 12:01:18 +01:00
parent 0036ce6ab2
commit ecd19c46bb
41 changed files with 721 additions and 131 deletions
@@ -242,7 +242,12 @@ export class ExpedienteDetailPage implements OnInit {
this.close();
this.toastService._successMessage('Processo aprovado')
} catch (error) {
this.toastService._badRequest('Processo não aprovado')
if(error.status == 0) {
this.toastService._badRequest('sem conexão ao servidor')
} else {
this.toastService._badRequest('Processo não aprovado')
}
} finally {
loader.remove()
}
@@ -267,7 +272,12 @@ export class ExpedienteDetailPage implements OnInit {
this.close();
this.toastService._successMessage()
} catch (error) {
this.toastService._badRequest()
if(error.status == 0) {
this.toastService._badRequest('sem conexão ao servidor')
} else {
this.toastService._badRequest()
}
} finally {
loader.remove()
}
@@ -334,7 +344,12 @@ export class ExpedienteDetailPage implements OnInit {
},
(error) => {
loader.remove()
this.toastService._badRequest('Processo não enviado para pendentes')
if(error.status == 0) {
this.toastService._badRequest('sem conexão ao servidor')
} else {
this.toastService._badRequest('Processo não enviado para pendentes')
}
});
}
@@ -391,7 +406,12 @@ export class ExpedienteDetailPage implements OnInit {
} catch (e) {
window.history.back();
}
this.toastService._badRequest('Processo não encontrado')
if(error.status == 0) {
this.toastService._badRequest('sem conexão ao servidor')
} else {
this.toastService._badRequest('Processo não encontrado')
}
}
});
@@ -482,8 +502,13 @@ export class ExpedienteDetailPage implements OnInit {
loader.remove()
await this.attachmentsService.AddAttachment(body).toPromise()
this.toastService._successMessage()
} catch(e) {
} catch(error) {
if(error.status == 0) {
this.toastService._badRequest('sem conexão ao servidor')
} else {
this.toastService._badRequest()
}
}
});
}
@@ -519,7 +544,12 @@ export class ExpedienteDetailPage implements OnInit {
await this.processes.CompleteTask(body).toPromise();
this.goBack();
} catch (error) {
this.toastService._badRequest('Processo não descartado')
if(error.status == 0) {
this.toastService._badRequest('sem conexão ao servidor')
} else {
this.toastService._badRequest('Processo não descartado')
}
} finally {
loader.remove()
}
@@ -553,7 +583,12 @@ export class ExpedienteDetailPage implements OnInit {
this.toastService._successMessage('Processo descartado');
this.goBack();
} catch (error) {
this.toastService._badRequest('Processo não descartado')
if(error.status == 0) {
this.toastService._badRequest('sem conexão ao servidor')
} else {
this.toastService._badRequest('Processo não descartado')
}
} finally {
loader.remove()
}
@@ -572,7 +607,12 @@ export class ExpedienteDetailPage implements OnInit {
//this.toastService._successMessage('Processo descartado');
this.goBack();
} catch (error) {
this.toastService._badRequest('Processo não descartado')
if(error.status == 0) {
this.toastService._badRequest('sem conexão ao servidor')
} else {
this.toastService._badRequest('Processo não descartado')
}
} finally {
loader.remove()
}
@@ -586,7 +626,12 @@ export class ExpedienteDetailPage implements OnInit {
this.toastService._successMessage();
this.goBack();
} catch (error) {
this.toastService._badRequest()
if(error.status == 0) {
this.toastService._badRequest('sem conexão ao servidor')
} else {
this.toastService._badRequest()
}
} finally {
loader.remove()
}