fixed issue with calculating dates, added api for posting a game to the server

This commit is contained in:
Michael Simard
2020-12-09 14:11:44 -06:00
parent 26fdc1e39a
commit f10a360556
4 changed files with 67 additions and 19 deletions

View File

@@ -23,11 +23,18 @@ final class Match: Model, Content {
var roundsLost: Int?
@Field(key: "codGame")
var codGame: String
var codGame: String?
@Field(key: "notes")
var notes: String?
@Field(key: "players")
var players: String?
init() { }
init(id: UUID? = nil, map:String?, win:Bool, date:Date, roundsWon:Int?, roundsLost:Int?, codGame:String) {
init(id: UUID? = nil, map:String?, win:Bool, date:Date, roundsWon:Int?, roundsLost:Int?, codGame:String?, notes:String?, players:String?) {
self.id = id
self.map = map
self.win = win
@@ -35,6 +42,8 @@ final class Match: Model, Content {
self.roundsWon = roundsWon
self.roundsLost = roundsLost
self.codGame = codGame;
self.notes = notes;
self.players = players
}
}