This commit is contained in:
Peter Maquiran
2021-12-21 15:46:26 +01:00
parent bb22042ed8
commit 95d014e70a
3 changed files with 49 additions and 12 deletions
@@ -26,7 +26,6 @@ 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'
const moment = _rollupMoment || _moment;
const CUSTOM_DATE_FORMATS: NgxMatDateFormats = {
@@ -109,9 +108,9 @@ export class NewEventPage implements OnInit {
public stepMinutes = [1, 5, 10, 15, 20, 25];
public stepSeconds = [1, 5, 10, 15, 20, 25];
showLoader = false
CalendarName;
constructor(
private modalController: ModalController,
@@ -133,13 +132,15 @@ export class NewEventPage implements OnInit {
ngOnInit() {
this.CalendarName = this.loggeduser.Profile;
this.getRecurrenceTypes();
if(!this.restoreTemporaryData()){
// clear
this.eventBody = { BodyType : "1", Text : ""};
this.postEvent.Body = this.eventBody;
/* console.log(this.profile); */
/* console.log(this.profile); */
let selectedStartdDate = this.selectedDate;
let selectedEndDate = new Date(this.selectedDate);
@@ -352,19 +353,12 @@ export class NewEventPage implements OnInit {
this.postEvent.EventRecurrence.Type = '-1'
}
if(this.loggeduser.Profile == 'MDGPR') {
// console.log('MD - Aqui');
// console.log(this.postEvent);
if(this.CalendarName == 'MDGPR') {
this.showLoader = true;
console.log(this.postEvent);
let loader = this.toastService.loading();
console.log(this.postEvent);
this.eventService.postEventMd(this.postEvent, this.postEvent.CalendarName).subscribe(
async (id) => {
@@ -415,7 +409,7 @@ export class NewEventPage implements OnInit {
});
}
else if(this.loggeduser.Profile == 'PR') {
else if(this.CalendarName == 'PR') {
console.log('PR - Aqui');
console.log(this.postEvent);
this.eventService.postEventPr(this.postEvent, this.postEvent.CalendarName).subscribe(