Fix duplicated infrastructures/servers
Leftover from some refactoring, was not deleting older infrastructures before adding a new one.
This commit is contained in:
parent
15a4cc8f75
commit
ae6b5c50d9
|
@ -55,6 +55,8 @@ class InfrastructureRepository: Repository {
|
|||
infrastructure.name,
|
||||
vpnProtocol.rawValue
|
||||
)
|
||||
let existing = try context.fetch(request)
|
||||
existing.forEach(context.delete)
|
||||
|
||||
let dto = InfrastructureMapper(
|
||||
context,
|
||||
|
|
Loading…
Reference in New Issue