From 30306d2d50a141769a0d4848377d07873387c302 Mon Sep 17 00:00:00 2001 From: Laurent Date: Fri, 27 Sep 2024 16:42:16 +0200 Subject: [PATCH] Adds creationDate on ApiCall --- LeStorage/ApiCallCollection.swift | 2 +- LeStorage/Codables/ApiCall.swift | 5 ++--- 2 files changed, 3 insertions(+), 4 deletions(-) diff --git a/LeStorage/ApiCallCollection.swift b/LeStorage/ApiCallCollection.swift index 82b203e..a48ab5d 100644 --- a/LeStorage/ApiCallCollection.swift +++ b/LeStorage/ApiCallCollection.swift @@ -99,7 +99,7 @@ actor ApiCallCollection: SomeCallCollection { /// Deletes an API call by [id] func deleteById(_ id: String) { self.items.removeAll(where: { $0.id == id }) - Logger.log("\(T.resourceName()) > Delete by id, count after deletion = \(self.items.count)") +// Logger.log("\(T.resourceName()) > Delete by id, count after deletion = \(self.items.count)") self._hasChanged = true } diff --git a/LeStorage/Codables/ApiCall.swift b/LeStorage/Codables/ApiCall.swift index 6666c96..fbd5ccb 100644 --- a/LeStorage/Codables/ApiCall.swift +++ b/LeStorage/Codables/ApiCall.swift @@ -21,8 +21,8 @@ class ApiCall: ModelObject, Storable, SomeCall { var id: String = Store.randomId() - /// The http URL of the call -// var url: String + /// Creation date of the call + var creationDate: Date = Date() /// The HTTP method of the call: post... var method: HTTPMethod @@ -40,7 +40,6 @@ class ApiCall: ModelObject, Storable, SomeCall { var lastAttemptDate: Date = Date() init(method: HTTPMethod, dataId: String, body: String) { -// self.url = url self.method = method self.dataId = dataId self.body = body