From 7dd1cd01b296ba53b9613adfa597871228cd63a4 Mon Sep 17 00:00:00 2001 From: dankito Date: Tue, 1 Sep 2020 15:09:13 +0200 Subject: [PATCH] Implemented that customer only gets inserted if he/she hasn't been inserted yet (but should make actually no difference) --- .../persistence/CoreDataBankingPersistence.swift | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/ui/BankingiOSApp/BankingiOSApp/persistence/CoreDataBankingPersistence.swift b/ui/BankingiOSApp/BankingiOSApp/persistence/CoreDataBankingPersistence.swift index e4d45fd5..f89f6092 100644 --- a/ui/BankingiOSApp/BankingiOSApp/persistence/CoreDataBankingPersistence.swift +++ b/ui/BankingiOSApp/BankingiOSApp/persistence/CoreDataBankingPersistence.swift @@ -23,7 +23,9 @@ class CoreDataBankingPersistence: IBankingPersistence, IRemitteeSearcher { do { let mapped = mapper.map(customer, context) - context.insert(mapped) + if customer.technicalId.isCoreDataId == false { // an unpersisted bank (but check should not be necessary) + context.insert(mapped) + } try context.save()