git sucks

This commit is contained in:
jmosrael@gmail.com
2024-05-26 20:43:10 -07:00
parent 79db675a6a
commit 65378473e0
3 changed files with 12 additions and 6 deletions

View File

@@ -50,7 +50,9 @@ export function addGameApis(app, jsonParser) {
app.post('/api/game/:gameId/apps', async (req, res) => {
try {
const apps = await App.findAll({ where: { gameId: req.params['gameId'] } })
const apps = await App.findAll({
include: { model: Character, as: "appliedCharacter"},
where: { gameId: req.params['gameId'] } })
if (!apps) {
res.status(404).send('Apps not found.')
} else {
@@ -63,7 +65,9 @@ export function addGameApis(app, jsonParser) {
app.post('/api/game/:gameId/picks', async (req, res) => {
try {
const picks = await Pick.findAll({ where: { gameId: req.params['gameId'] } })
const picks = await Pick.findAll({
include: { model: Character, as: "pickedCharacter"},
where: { gameId: req.params['gameId'] } })
if (!picks) {
res.status(404).send('Picks not found')
} else {