From 04782194e1226c6dbebd1f651611b31ded652799 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jos=C3=A9=20Neto?= Date: Fri, 3 Mar 2023 10:50:20 +0000 Subject: [PATCH] async save --- .../manager/Controllers/ApodManagerController.swift | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/Sources/manager/Controllers/ApodManagerController.swift b/Sources/manager/Controllers/ApodManagerController.swift index 4b56c29..765d66a 100644 --- a/Sources/manager/Controllers/ApodManagerController.swift +++ b/Sources/manager/Controllers/ApodManagerController.swift @@ -57,10 +57,10 @@ public class ApodManagerController { private func saveItems(_ items: [NasaApodDto]?) async throws { let itemsAdd: [ApodStorage] = items?.map { ApodStorage($0) } ?? [] - try storageController.saveItemsSql(itemsAdd) - self.items = try getAll()?.mapToEntity() - // for item in itemsAdd { - // try await storageController.asyncSaveItem(item) - // } + // try storageController.saveItemsSql(itemsAdd) + // self.items = try getAll()?.mapToEntity() + for item in itemsAdd { + try await storageController.asyncSaveItem(item) + } } }