to many changes

This commit is contained in:
Eudes Inácio
2023-02-27 17:39:10 +01:00
parent fcd1989334
commit 46387d4977
30 changed files with 329 additions and 160 deletions
@@ -19,6 +19,7 @@ import { EventService } from 'src/app/services/rules/event.service';
import { EventPipe } from 'src/app/pipes/event.pipe';
import { ThemeService } from 'src/app/services/theme.service'
import { SessionStore } from 'src/app/store/session.service';
import { HttpErrorHandle } from 'src/app/services/http-error-handle.service';
const CUSTOM_DATE_FORMATS: NgxMatDateFormats = {
@@ -106,6 +107,7 @@ export class DocumentSetUpMeetingPage implements OnInit {
private eventService: EventService,
public ThemeService: ThemeService,
public _eventService: EventsService,
private httpErroHandle: HttpErrorHandle
) {
this.loggeduser = SessionStore.user;
this.document = this.navParams.get('document')
@@ -291,17 +293,11 @@ export class DocumentSetUpMeetingPage implements OnInit {
this.eventService.create({ body: postEvent, calendar: this.postData.CalendarName }).subscribe(async (respose) => {
laoder.remove()
this.toastService._successMessage('Reunião criada')
this.httpErroHandle.httpsSucessMessagge('new event');
this.modalController.dismiss()
}, (error) => {
laoder.remove()
if(error.status == 0) {
this.toastService._badRequest('Sem acesso à internet. Por favor verifique sua conexão')
} else if(error.error.includes('attachments')) {
throw(error.error + JSON.stringify(postEvent.Attachments))
} else {
this.toastService._badRequest('Não foi possível marcar a reunião');
}
this.httpErroHandle.httpStatusHandle(error)
}, ()=>{
laoder.remove()
});
+7 -3
View File
@@ -18,6 +18,7 @@ import { EditEventPage } from 'src/app/pages/agenda/edit-event/edit-event.page';
import { ExpedientTaskModalPage } from 'src/app/pages/gabinete-digital/expediente/expedient-task-modal/expedient-task-modal.page';
import { RouteService } from 'src/app/services/route.service';
import { SessionStore } from 'src/app/store/session.service';
import { HttpErrorHandle } from 'src/app/services/http-error-handle.service';
@Component({
@@ -70,7 +71,8 @@ export class ViewEventPage implements OnInit {
private sqliteservice: SqliteService,
private backgroundservice: BackgroundService,
private storage: StorageService,
public ThemeService: ThemeService
public ThemeService: ThemeService,
private httpErrorHandle: HttpErrorHandle
) {
this.eventId = this.navParams.get('eventId');
this.CalendarId = this.navParams.get('CalendarId');
@@ -191,8 +193,10 @@ export class ViewEventPage implements OnInit {
alert.dismiss();
}, 1500);
this.goBack();
this.toastService._successMessage('Evento apagado');
}, () => { },
this.httpErrorHandle.httpsSucessMessagge('Evento eliminado')
}, (error) => {
this.httpErrorHandle.httpStatusHandle(error)
},
() => {
loader.remove();
});