|
|
|
|
@ -294,13 +294,20 @@ public class StoredCollection<T: Storable>: RandomAccessCollection, SomeCollecti |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
/// Proceeds to "hard" delete the items without synchronizing them |
|
|
|
|
/// Also removes related API calls |
|
|
|
|
public func deleteDependencies(_ items: any Sequence<T>) { |
|
|
|
|
defer { |
|
|
|
|
self._hasChanged = true |
|
|
|
|
} |
|
|
|
|
for item in items { |
|
|
|
|
self.items.removeAll(where: { $0.id == item.id }) |
|
|
|
|
|
|
|
|
|
/// remove related API call if existing |
|
|
|
|
if let apiCallIndex = self.apiCallsCollection?.firstIndex(where: { $0.dataId == item.id }) { |
|
|
|
|
self.apiCallsCollection?.items.remove(at: apiCallIndex) |
|
|
|
|
} |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
public func deleteAll() throws { |
|
|
|
|
|