From 389f5b851ea8a7ece43bd0cddaa9d1f7dee66478 Mon Sep 17 00:00:00 2001 From: Laurent Date: Sun, 16 Feb 2025 11:48:48 +0100 Subject: [PATCH] Fix issue with call creation --- LeStorage/ApiCallCollection.swift | 3 +-- LeStorageTests/ApiCallTests.swift | 2 +- 2 files changed, 2 insertions(+), 3 deletions(-) diff --git a/LeStorage/ApiCallCollection.swift b/LeStorage/ApiCallCollection.swift index fdab25d..f87d2c0 100644 --- a/LeStorage/ApiCallCollection.swift +++ b/LeStorage/ApiCallCollection.swift @@ -230,8 +230,7 @@ actor ApiCallCollection: SomeCallCollection { case (.post, .put): call = try self._createCall(instance, method: .post) case (.post, .delete): - self._deleteCalls(existingCalls) - return nil + call = try self._createCall(instance, method: .delete) case (.put, .put): call = try self._createCall(instance, method: .put) case (.put, .delete): diff --git a/LeStorageTests/ApiCallTests.swift b/LeStorageTests/ApiCallTests.swift index 9ee3401..bd5a7eb 100644 --- a/LeStorageTests/ApiCallTests.swift +++ b/LeStorageTests/ApiCallTests.swift @@ -43,7 +43,7 @@ struct ApiCallTests { } let _ = try await collection.sendDeletion(thing) - await #expect(collection.items.count == 0) + await #expect(collection.items.count == 1) } @Test func testApiCallProvisioning2() async throws {