Implemented that customer only gets inserted if he/she hasn't been inserted yet (but should make actually no difference)

This commit is contained in:
dankito 2020-09-01 15:09:13 +02:00
parent 11b55a6ecc
commit 7dd1cd01b2
1 changed files with 3 additions and 1 deletions

View File

@ -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()