This commit is contained in:
2022-04-02 14:13:37 +01:00
parent c0a500f5e0
commit fa25462897
9 changed files with 409 additions and 104 deletions
@@ -13,6 +13,7 @@ import { ToastService } from 'src/app/services/toast.service';
import { FormControl, FormGroup, Validators } from '@angular/forms';
import { ParticipantsPipe } from 'src/app/pipes/participants.pipe';
import { ThemeService } from 'src/app/services/theme.service'
import { SessionStore } from 'src/app/store/session.service';
@Component({
selector: 'app-edit-event',
@@ -83,6 +84,7 @@ export class EditEventPage implements OnInit {
public stepSeconds = [1, 5, 10, 15, 20, 25];
private participantsPipe = new ParticipantsPipe()
sesseionStora = SessionStore
constructor(
private modalController: ModalController,
@@ -258,19 +260,37 @@ export class EditEventPage implements OnInit {
this.showLoader = true;
try {
await this.eventsService.editEvent(this.postEvent, 2, 3).toPromise()
if(this.initCalendarName != this.postEvent.CalendarName) {
let body = {
"EventId": this.postEvent.EventId,
"CalendarDestinationName": this.postEvent.CalendarName,
if(this.sesseionStora.user.Profile == 'MDGPR' || this.sesseionStora.user.Profile == 'PR') {
await this.eventsService.editEvent(this.postEvent, 2, 3).toPromise()
if(this.initCalendarName != this.postEvent.CalendarName) {
let body = {
"EventId": this.postEvent.EventId,
"CalendarDestinationName": this.postEvent.CalendarName,
}
try {
await this.eventsService.changeAgenda(body).toPromise();
} catch (e) {}
}
try {
await this.eventsService.changeAgenda(body).toPromise();
} catch (e) {}
this.showLoader = false;
this.toastService.successMessage()
} else {
await this.eventsService.editEvent(this.postEvent, 2, 3).toPromise()
if(this.initCalendarName != this.postEvent.CalendarName) {
let body = {
"EventId": this.postEvent.EventId,
"CalendarDestinationName": this.postEvent.CalendarName,
}
try {
await this.eventsService.changeAgenda(body).toPromise();
} catch (e) {}
}
this.showLoader = false;
this.toastService.successMessage()
}
this.showLoader = false;
this.toastService.successMessage()
} catch(error) {
this.showLoader = false
this.toastService.badRequest()