mirror of
https://github.com/Mueller-Patrick/DHBW-Service-App.git
synced 2024-12-22 13:25:13 +00:00
🐛 Fixed bug where the app would create new RaPlaEvent objects instead of updating the existing ones
This commit is contained in:
parent
ba0d4da657
commit
f5756cd650
|
@ -156,10 +156,10 @@ class RaPlaFetcher {
|
|||
// Save the given iCalEvent objects to CoreData
|
||||
// Updates the events if they already exist and deletes old (/invalid) ones
|
||||
private class func saveToCoreData(eventObjects: [iCalEvent]) -> Bool{
|
||||
let existingEvents: [RaPlaEvent] = [] //RaPlaEvent.getAll()
|
||||
let existingEvents: [RaPlaEvent] = RaPlaEvent.getAll()
|
||||
var existingEventsDict: [String:RaPlaEvent] = [:]
|
||||
for event in existingEvents {
|
||||
existingEventsDict[event.value(forKey: "uid") as! String] = event
|
||||
existingEventsDict[event.uid!] = event
|
||||
}
|
||||
let newEventUIDs = eventObjects.map{$0.uid}
|
||||
|
||||
|
|
Loading…
Reference in New Issue
Block a user