fix(more-matches): update the sidebar with the season filter applied

This commit is contained in:
Valentin Kaelin 2020-11-14 18:47:17 +01:00
parent 67ff3380a0
commit 5fad14e3af
2 changed files with 3 additions and 2 deletions

View file

@ -35,7 +35,7 @@ export default class MatchesController {
*/ */
public async index ({ request, response }: HttpContextContract) { public async index ({ request, response }: HttpContextContract) {
console.log('More Matches Request') console.log('More Matches Request')
const { puuid, accountId, region, gameIds } = await request.validate(MatchesIndexValidator) const { puuid, accountId, region, gameIds, season } = await request.validate(MatchesIndexValidator)
const summonerDB = await Summoner.findOne({ puuid }) const summonerDB = await Summoner.findOne({ puuid })
if (!summonerDB) { if (!summonerDB) {
@ -45,7 +45,7 @@ export default class MatchesController {
await summonerDB.save() await summonerDB.save()
const stats = await StatsService.getSummonerStats(puuid) const stats = await StatsService.getSummonerStats(puuid, season)
return response.json({ return response.json({
matches, matches,

View file

@ -31,6 +31,7 @@ export default class MatchesIndexValidator {
gameIds: schema.array().members( gameIds: schema.array().members(
schema.number() schema.number()
), ),
season: schema.number.optional(),
}) })
/** /**