patch rooms/:id failure to return multiple games
This commit is contained in:
parent
e3ce466bb4
commit
f6d4ed49ca
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 |
|
@ -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) => {
|
||||
|
|
Loading…
Reference in a new issue