This commit is contained in:
tiago.kayaya
2021-09-15 09:33:13 +01:00
parent fb5d7d797c
commit 90e0ee62fa
6 changed files with 98 additions and 70 deletions
@@ -35,19 +35,19 @@ export class EditEventPage implements OnInit {
profile:string;
constructor(
public formBuilder: FormBuilder,
public alertController: AlertController,
private router: Router,
private activatedRoute: ActivatedRoute,
private eventsService: EventsService,
public formBuilder: FormBuilder,
public alertController: AlertController,
private router: Router,
private activatedRoute: ActivatedRoute,
private eventsService: EventsService,
private modalCtrl: ModalController,
private alertService: AlertService,
private attachamentsService: AttachmentsService,
private route: Router,
private iab: InAppBrowser) {
private iab: InAppBrowser) {
this.loadedEvent = new Event();
this.loadedEvent.Body = new EventBody();
}
ngOnInit() {
@@ -73,7 +73,7 @@ export class EditEventPage implements OnInit {
this.pageId = paramMap.get('eventId');
eventid = paramMap.get('eventId');
console.log(eventid);
}
if (paramMap.has("caller")){
this.backURL = "/home/" + paramMap.get('caller');
@@ -99,7 +99,7 @@ export class EditEventPage implements OnInit {
modal.onDidDismiss().then((data) => {
if (data['data'] != null)
{
{
let newattendees: EventPerson[] = data['data'];
this.loadedEvent.Attendees = newattendees;
}
@@ -142,20 +142,20 @@ export class EditEventPage implements OnInit {
Delete()
{
this.eventsService.deleteEvent(this.loadedEvent.EventId, 0).subscribe(async () =>
this.eventsService.deleteEvent(this.loadedEvent.EventId, 0, this.loadedEvent.CalendarName).subscribe(async () =>
{
const alert = await this.alertController.create({
cssClass: 'my-custom-class',
header: 'Evento removido',
buttons: ['OK']
});
setTimeout(()=>{
alert.dismiss();
}, 1500);
this.router.navigate(['/home/events']);
});
});
}
Save()
@@ -165,18 +165,18 @@ export class EditEventPage implements OnInit {
this.activatedRoute.paramMap.subscribe(paramMap =>{
if (paramMap.has("profile")){
console.log(paramMap.get('profile'));
}
});
this.eventsService.editEvent(this.loadedEvent, 2, 3).subscribe(async () =>
this.eventsService.editEvent(this.loadedEvent, 2, 3).subscribe(async () =>
{
const alert = await this.alertController.create({
cssClass: 'my-custom-class',
header: 'Evento actualizado',
buttons: ['OK']
});
setTimeout(()=>{
alert.dismiss();
}, 1500);
@@ -189,13 +189,13 @@ export class EditEventPage implements OnInit {
}
loadAttachments()
{
{
/* console.log(this.pageId); */
this.attachamentsService.getAttachmentsById(this.pageId).subscribe(res => {
this.loadedEventAttachments = res;
console.log(res);
});
}
async viewDocument(documenturl:string)
@@ -230,12 +230,12 @@ export class EditEventPage implements OnInit {
cssClass: 'attachments',
backdropDismiss: false
});
await modal.present();
modal.onDidDismiss().then((data) => {
if (data['data'] != null)
{
{
let newattendees: EventPerson[] = data['data'];
this.loadedEvent.Attendees = newattendees;
}