remove sqlite and unused import

This commit is contained in:
Peter Maquiran
2023-06-11 13:36:27 +01:00
parent f7b54a04ba
commit acb79bb62e
26 changed files with 438 additions and 1256 deletions
@@ -138,23 +138,23 @@ export class ViewEventPage implements OnInit {
}
getEventsFromDB () {
// getEventsFromDB () {
return new Promise((resolve, reject) => {
if (this.platform.is('desktop') || this.platform.is('mobileweb')) {
this.storage.get('agendaResponse').then((events) => {
resolve(events)
})
} else {
this.sqliteservice.getAllEvents().then((events: any[] = []) => {
resolve(events)
// return new Promise((resolve, reject) => {
// if (this.platform.is('desktop') || this.platform.is('mobileweb')) {
// this.storage.get('agendaResponse').then((events) => {
// resolve(events)
// })
// } else {
// this.sqliteservice.getAllEvents().then((events: any[] = []) => {
// resolve(events)
})
}
}).catch ((error) => {
console.error(error);
});
}
// })
// }
// }).catch ((error) => {
// console.error(error);
// });
// }
close() {
@@ -193,7 +193,7 @@ export class ViewEventPage implements OnInit {
this.eventsService.getEvent(this.eventId).subscribe(res => {
this.loadedEvent = res;
this.addEventToDb(res);
// this.addEventToDb(res);
loader.remove()
}, (error) => {
@@ -220,7 +220,7 @@ export class ViewEventPage implements OnInit {
res.Body.Text = div.innerText
this.loadedEvent = res;
this.addEventToDb(res);
// this.addEventToDb(res);
loader.remove()
}, (error) => {
@@ -511,36 +511,36 @@ export class ViewEventPage implements OnInit {
}
addEventToDb(data) {
if (this.platform.is('desktop') || this.platform.is('mobileweb')) {
this.ionicStorage.set('eventDetails', data).then(() => {
// addEventToDb(data) {
// if (this.platform.is('desktop') || this.platform.is('mobileweb')) {
// this.ionicStorage.set('eventDetails', data).then(() => {
})
} else {
let event = {
Attendees: JSON.stringify(data.Attendees) || JSON.stringify(''),
Body: JSON.stringify(data.Body) || JSON.stringify(''),
CalendarId: data.CalendarId,
CalendarName: data.CalendarName,
Category: data.Category,
EndDate: data.EndDate,
EventId: data.EventId,
EventRecurrence: JSON.stringify(data.EventRecurrence) || JSON.stringify(''),
EventType: data.EventType,
HasAttachments: data.HasAttachments,
IsAllDayEvent: data.IsAllDayEvent,
IsMeeting: data.IsMeeting,
IsRecurring: data.IsRecurring,
Location: data.Location,
Organizer: JSON.stringify(data.Organizer) || JSON.stringify(''),
StartDate: data.StartDate,
Subject: data.Subject,
TimeZone: data.TimeZone
}
// })
// } else {
// let event = {
// Attendees: JSON.stringify(data.Attendees) || JSON.stringify(''),
// Body: JSON.stringify(data.Body) || JSON.stringify(''),
// CalendarId: data.CalendarId,
// CalendarName: data.CalendarName,
// Category: data.Category,
// EndDate: data.EndDate,
// EventId: data.EventId,
// EventRecurrence: JSON.stringify(data.EventRecurrence) || JSON.stringify(''),
// EventType: data.EventType,
// HasAttachments: data.HasAttachments,
// IsAllDayEvent: data.IsAllDayEvent,
// IsMeeting: data.IsMeeting,
// IsRecurring: data.IsRecurring,
// Location: data.Location,
// Organizer: JSON.stringify(data.Organizer) || JSON.stringify(''),
// StartDate: data.StartDate,
// Subject: data.Subject,
// TimeZone: data.TimeZone
// }
this.sqliteservice.updateEvent(event);
}
}
// this.sqliteservice.updateEvent(event);
// }
// }
getFromDb() {