From c51b6e1906130cfc9862d849e67aba0901049a30 Mon Sep 17 00:00:00 2001 From: Laurent Date: Mon, 16 Dec 2024 09:45:51 +0100 Subject: [PATCH] Fix missing method --- LeStorage/StoredCollection+Sync.swift | 5 +++++ LeStorage/StoredCollection.swift | 6 +++--- 2 files changed, 8 insertions(+), 3 deletions(-) diff --git a/LeStorage/StoredCollection+Sync.swift b/LeStorage/StoredCollection+Sync.swift index 59b817e..eaa3503 100644 --- a/LeStorage/StoredCollection+Sync.swift +++ b/LeStorage/StoredCollection+Sync.swift @@ -149,6 +149,11 @@ extension StoredCollection: SomeSyncedCollection where T : SyncedStorable { } + /// Proceeds to delete all instance of the collection, properly cleaning up dependencies and sending API calls + public func deleteAll() throws { + self.delete(contentOfs: self.items) + } + /// Deletes all items of the sequence by id and sets the collection as changed to trigger a write public func delete(contentOfs sequence: any Sequence) { diff --git a/LeStorage/StoredCollection.swift b/LeStorage/StoredCollection.swift index bb837ee..003c098 100644 --- a/LeStorage/StoredCollection.swift +++ b/LeStorage/StoredCollection.swift @@ -331,9 +331,9 @@ public class StoredCollection: RandomAccessCollection, SomeCollecti } /// Proceeds to delete all instance of the collection, properly cleaning up dependencies and sending API calls - // public func deleteAll() throws { - // try self.delete(contentOfs: self.items) - // } + public func deleteAll() throws { + self.delete(contentOfs: self.items) + } // MARK: - SomeCall