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
@@ -142,7 +142,12 @@ export class OptsExpedientePrPage 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()
}
@@ -180,7 +185,12 @@ export class OptsExpedientePrPage 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()
}
@@ -199,7 +209,12 @@ export class OptsExpedientePrPage 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()
}
@@ -214,7 +229,12 @@ export class OptsExpedientePrPage 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()
}
@@ -242,7 +262,12 @@ export class OptsExpedientePrPage 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()
}
@@ -255,9 +280,13 @@ export class OptsExpedientePrPage implements OnInit {
this.processes.SetTaskToPending(this.task.SerialNumber).subscribe(res=>{
loader.remove()
this.close();
},()=>{
this.toastService._badRequest('Processo não encontrado')
}, (error) => {
if(error.status == 0) {
this.toastService._badRequest('sem conexão ao servidor')
} else {
this.toastService._badRequest('Processo não encontrado')
}
loader.remove()
});
}
@@ -295,7 +324,11 @@ export class OptsExpedientePrPage 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()
}