support for update

This commit is contained in:
Michael Simard
2021-01-09 09:56:27 -06:00
parent ae66dfd1d6
commit 523b480376
3 changed files with 52 additions and 2 deletions

View File

@@ -46,6 +46,22 @@ final class Match: Model, Content {
self.players = players
}
func update( newMatch:Match) {
guard let _ = newMatch.id else {
return
}
self.map = newMatch.map
self.win = newMatch.win
self.date = newMatch.date
self.roundsWon = newMatch.roundsWon
self.roundsLost = newMatch.roundsLost
self.codGame = newMatch.codGame;
self.notes = newMatch.notes;
self.players = newMatch.players
}
}
extension Match {