mirror of
https://code.equilibrium.co.ao/ITO/doneit-web.git
synced 2026-04-19 21:06:06 +00:00
fix view event in some component
This commit is contained in:
@@ -16,7 +16,7 @@ import { ExpedientTaskModalPage } from 'src/app/pages/gabinete-digital/expedient
|
||||
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';
|
||||
|
||||
import { AgendaDataRepositoryService } from 'src/app/services/Repositorys/Agenda/agenda-data-repository.service';
|
||||
|
||||
@Component({
|
||||
selector: 'app-view-event',
|
||||
@@ -64,7 +64,8 @@ export class ViewEventPage implements OnInit {
|
||||
private backgroundservice: BackgroundService,
|
||||
private storage: StorageService,
|
||||
public ThemeService: ThemeService,
|
||||
private httpErrorHandle: HttpErrorHandle
|
||||
private httpErrorHandle: HttpErrorHandle,
|
||||
private agendaDataRepository: AgendaDataRepositoryService
|
||||
) {
|
||||
this.eventId = this.navParams.get('eventId');
|
||||
this.CalendarId = this.navParams.get('CalendarId');
|
||||
@@ -106,7 +107,6 @@ export class ViewEventPage implements OnInit {
|
||||
}
|
||||
|
||||
close() {
|
||||
|
||||
this.modalController.dismiss(this.isEventEdited);
|
||||
}
|
||||
|
||||
@@ -119,7 +119,7 @@ export class ViewEventPage implements OnInit {
|
||||
ev.target.complete();
|
||||
}
|
||||
|
||||
loadEvent() {
|
||||
async loadEvent() {
|
||||
const loader = this.toastService.loading();
|
||||
|
||||
if(this.sesseionStora.user.Profile == 'MDGPR' || this.sesseionStora.user.Profile == 'PR') {
|
||||
@@ -168,6 +168,28 @@ export class ViewEventPage implements OnInit {
|
||||
|
||||
}
|
||||
|
||||
|
||||
|
||||
let res = await this.agendaDataRepository.getEventById(this.eventId)
|
||||
|
||||
if(res.isOk()) {
|
||||
this.loadedEvent = res.value as any;
|
||||
// this.addEventToDb(res);
|
||||
|
||||
loader.remove()
|
||||
} else {
|
||||
if (res.error.status === 0) {
|
||||
// this.getFromDb();
|
||||
} else {
|
||||
this.toastService.badRequest('Este evento já não existe na sua agenda')
|
||||
loader.remove()
|
||||
this.modalController.dismiss('Eevent not Foud');
|
||||
this.RouteService.goBack();
|
||||
}
|
||||
loader.remove()
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
|
||||
deleteEvent() {
|
||||
|
||||
Reference in New Issue
Block a user