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