|
|
|
@ -478,6 +478,14 @@ struct MatchDetailView: View { |
|
|
|
} label: { |
|
|
|
} label: { |
|
|
|
Text("Terrain") |
|
|
|
Text("Terrain") |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
.onChange(of: fieldSetup) { |
|
|
|
|
|
|
|
if let courtIndex = fieldSetup.courtIndex { |
|
|
|
|
|
|
|
match.setCourt(courtIndex) |
|
|
|
|
|
|
|
} else { |
|
|
|
|
|
|
|
match.removeCourt() |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
_saveMatch() |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
RowButtonView("Valider") { |
|
|
|
RowButtonView("Valider") { |
|
|
|
match.validateMatch(fromStartDate: startDateSetup == .now ? Date() : startDate, toEndDate: endDate, fieldSetup: fieldSetup) |
|
|
|
match.validateMatch(fromStartDate: startDateSetup == .now ? Date() : startDate, toEndDate: endDate, fieldSetup: fieldSetup) |
|
|
|
@ -540,6 +548,10 @@ struct MatchDetailView: View { |
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
_saveMatch() |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
private func _saveMatch() { |
|
|
|
do { |
|
|
|
do { |
|
|
|
try tournamentStore.matches.addOrUpdate(instance: match) |
|
|
|
try tournamentStore.matches.addOrUpdate(instance: match) |
|
|
|
} catch { |
|
|
|
} catch { |
|
|
|
|