Adds club to collection

multistore
Laurent 1 year ago
parent 0b2542bc29
commit 08c466e45f
  1. 11
      PadelClub/Views/Club/CreateClubView.swift

@ -50,11 +50,12 @@ struct CreateClubView: View {
//update existing club if rights ok / freshly created club with data input from user
if existingOrCreatedClub.hasBeenCreated(by: dataStore.user.id) {
existingOrCreatedClub.update(fromClub: club)
do {
try dataStore.clubs.addOrUpdate(instance: existingOrCreatedClub)
} catch {
Logger.error(error)
}
}
do {
try dataStore.clubs.addOrUpdate(instance: existingOrCreatedClub)
} catch {
Logger.error(error)
}
//save into user

Loading…
Cancel
Save