patch rooms/:id failure to return multiple games

This commit is contained in:
Sorrel Bri 2020-01-23 16:14:38 -08:00 committed by sorrelbri
parent 59b5d31c35
commit 6757553785
2 changed files with 7 additions and 3 deletions

Binary file not shown.

Before

Width:  |  Height:  |  Size: 3.8 KiB

After

Width:  |  Height:  |  Size: 318 B

View file

@ -6,15 +6,19 @@ const gameOverviewSelect = [
]
const findGameById = async (gameId) => {
return await knex('game')
const game = await knex('game')
.where({'id': gameId})
.select('*');
return game;
}
const findGameByRoom = async (roomId) => {
return await knex('game')
.where({'id': roomId})
const games = await knex('game')
.where({'room': roomId})
.select(gameOverviewSelect);
return games;
}
const insertGame = async (game) => {