mirror of
https://github.com/vkaelin/LeagueStats.git
synced 2026-03-25 12:57:28 +00:00
23 lines
773 B
TypeScript
23 lines
773 B
TypeScript
|
|
import { HttpContextContract } from '@ioc:Adonis/Core/HttpContext'
|
||
|
|
import MatchService from 'App/Services/MatchService'
|
||
|
|
import MatchesIndexValidator from 'App/Validators/MatchesIndexValidator'
|
||
|
|
|
||
|
|
export default class MatchesController {
|
||
|
|
/**
|
||
|
|
* POST - Return data from matches searched by gameIds
|
||
|
|
* @param ctx
|
||
|
|
*/
|
||
|
|
public async index({ request, response }: HttpContextContract) {
|
||
|
|
console.log('More Matches Request')
|
||
|
|
const { puuid, region, matchIds, season } = await request.validate(MatchesIndexValidator)
|
||
|
|
const matches = await MatchService.getMatches(region, matchIds, puuid)
|
||
|
|
|
||
|
|
// TODO: add Stats here
|
||
|
|
// const stats = await StatsService.getSummonerStats(puuid, season)
|
||
|
|
return response.json({
|
||
|
|
matches,
|
||
|
|
stats: 'TODO',
|
||
|
|
})
|
||
|
|
}
|
||
|
|
}
|