refining apps & picks

This commit is contained in:
iamBadgers
2024-04-27 20:20:47 -07:00
parent 0f163e500b
commit 2cdc335224
2 changed files with 2 additions and 7 deletions

View File

@@ -97,31 +97,26 @@ app.post('/api/game', jsonParser, async (req, res) => {
app.get('/api/game/:gameId', async (req, res) => {
const game = await Game.findOne({ where: { id: req.params['gameId'] } })
console.log(game)
res.send(game)
})
app.post('/api/game/:gameId/apps', async (req, res) => {
const apps = await App.findAll({ where: { gameId: req.params['gameId'] } })
console.log(apps)
res.send(apps)
})
app.post('/api/character/:characterId/apps', async (req, res) => {
const apps = await App.findAll({ where: { characterId: req.params['characterId'] } })
console.log(apps)
res.send(apps)
})
app.post('/api/game/:gameId/picks', async (req, res) => {
const picks = await Pick.findAll({ where: { gameId: req.params['gameId'] } })
console.log(picks)
res.send(picks)
})
app.post('/api/character/:characterId/picks', async (req, res) => {
const picks = await Pick.findAll({ where: { characterId: req.params['characterId'] } })
console.log(picks)
res.send(picks)
})

View File

@@ -9,12 +9,12 @@
<div>Picks</div>
<div v-for="pick in picks">
{{pick.characterId}} - {{pick.characterName}}
{{pick.characterName}}
</div>
<div>Apps</div>
<div v-for="app in apps">
{{app.characterId}} - {{app.characterName}}
{{app.characterName}}
</div>
</div>