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
@@ -192,7 +192,12 @@ export class ApproveEventPage implements OnInit {
this.toastService._successMessage('Evento enviado para revisão');
this.close();
} catch (error) {
this.toastService._badRequest();
if(error.status == 0) {
this.toastService._badRequest('sem conexão ao servidor')
} else {
this.toastService._badRequest();
}
} finally {
loader.remove()
}
@@ -415,7 +415,12 @@ export class EditEventToApprovePage implements OnInit {
this.toastService._successMessage();
this.goToApproveEventList();
} catch (error) {
this.toastService._badRequest();
if(error.status == 0) {
this.toastService._badRequest('sem conexão ao servidor')
} else {
this.toastService._badRequest();
}
} finally {
loader.remove()
}
@@ -3,7 +3,7 @@
<div class="main-header">
<div class="title-content">
<div class="middle">
<ion-label class="title">Novo Evento</ion-label>
<ion-label class="title">Novo Evento"</ion-label>
</div>
</div>
<ion-progress-bar class="calendar-progress-bar" type="indeterminate" *ngIf="showLoader"></ion-progress-bar>
@@ -25,6 +25,7 @@ import { FormGroup, Validators } from '@angular/forms';
import { NGX_MAT_DATE_FORMATS } from '@angular-material-components/datetime-picker';
import { ThemeService } from 'src/app/services/theme.service'
import { ChatMethodsService } from 'src/app/services/chat/chat-methods.service';
import { ServerConnectionService } from 'src/app/services/server-connection.service';
import { SessionStore } from 'src/app/store/session.service';
const CUSTOM_DATE_FORMATS: NgxMatDateFormats = {
@@ -129,6 +130,7 @@ export class NewEventPage implements OnInit {
private dateAdapter: DateAdapter<any>,
public ThemeService: ThemeService,
private chatMethodService: ChatMethodsService,
private ServerConnectionService: ServerConnectionService
// private translate: TranslateService
) {
this.dateAdapter.setLocale('pt');
@@ -529,9 +531,15 @@ export class NewEventPage implements OnInit {
},
error => {
console.log(error, 'error')
loader.remove()
this.showLoader = false
this.toastService._badRequest('Evento não criado')
if(error.status == 0) {
this.toastService._badRequest('sem conexão ao servidor')
} else {
this.toastService._badRequest('Evento não criado')
}
});
}
@@ -585,10 +593,19 @@ export class NewEventPage implements OnInit {
}
this.toastService._successMessage('Evento criado')
},()=>{
},(error) => {
//const connectionToServer = this.ServerConnectionService.BaseAPI()
if(error.status == 0) {
this.toastService._badRequest('sem conexão ao servidor')
} else {
this.toastService._badRequest('Evento não criado')
}
loader.remove()
this.showLoader = false
this.toastService._badRequest('Evento não criado')
});
} else {
@@ -641,10 +658,15 @@ export class NewEventPage implements OnInit {
this.chatMethodService.sendMessage(this.roomId,data);
}
this.toastService._successMessage('Evento criado')
},()=>{
},(error)=>{
loader.remove()
this.showLoader = false
this.toastService._badRequest('Evento não criado')
if(error.status == 0) {
this.toastService._badRequest('sem conexão ao servidor')
} else {
this.toastService._badRequest('Evento não criado')
}
});
}