patch rooms/:id failure to return multiple games

This commit is contained in:
Sorrel Bri 2020-01-23 16:14:38 -08:00
parent 015be6ca6b
commit f015f4242e
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) => { const findGameById = async (gameId) => {
return await knex('game') const game = await knex('game')
.where({'id': gameId}) .where({'id': gameId})
.select('*'); .select('*');
return game;
} }
const findGameByRoom = async (roomId) => { const findGameByRoom = async (roomId) => {
return await knex('game') const games = await knex('game')
.where({'id': roomId}) .where({'room': roomId})
.select(gameOverviewSelect); .select(gameOverviewSelect);
return games;
} }
const insertGame = async (game) => { const insertGame = async (game) => {