support for update
This commit is contained in:
@@ -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 {
|
||||
|
||||
Reference in New Issue
Block a user