added _dbHomeGameStats and _dbAwayGameStats with associated lenses

This commit is contained in:
Jonathan Lamothe
2019-08-27 11:10:57 -04:00
parent 3e4a9dd525
commit 13d422100b
2 changed files with 38 additions and 20 deletions

View File

@@ -312,13 +312,17 @@ gameStatsJSON n = Object $ HM.fromList
db :: Database
db = newDatabase
& dbPlayers .~ [player]
& dbGoalies .~ [goalie]
& dbGames .~ 1
& dbPlayers .~ [player]
& dbGoalies .~ [goalie]
& dbGames .~ 1
& dbHomeGameStats .~ gameStats 1
& dbAwayGameStats .~ gameStats 2
dbJSON :: Value
dbJSON = Object $ HM.fromList
[ ( "players", toJSON [playerJSON] )
, ( "goalies", toJSON [goalieJSON] )
, ( "games", toJSON (1 :: Int) )
[ ( "players", toJSON [playerJSON] )
, ( "goalies", toJSON [goalieJSON] )
, ( "games", toJSON (1 :: Int) )
, ( "home_game_stats", gameStatsJSON 1 )
, ( "away_game_stats", gameStatsJSON 2 )
]