mirror of
https://github.com/vkaelin/LeagueStats.git
synced 2026-03-25 12:57:28 +00:00
fix(more-matches): update the sidebar with the season filter applied
This commit is contained in:
parent
67ff3380a0
commit
5fad14e3af
2 changed files with 3 additions and 2 deletions
|
|
@ -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,
|
||||||
|
|
|
||||||
|
|
@ -31,6 +31,7 @@ export default class MatchesIndexValidator {
|
||||||
gameIds: schema.array().members(
|
gameIds: schema.array().members(
|
||||||
schema.number()
|
schema.number()
|
||||||
),
|
),
|
||||||
|
season: schema.number.optional(),
|
||||||
})
|
})
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue