public async Task <IActionResult> CheckShowdownLegality([FromRoute] string game, [FromBody, Required] PokemonShowdownRequest body) { var pkm = await PokemonService.GetPokemonFromShowdown(body.ShowdownSet, GetGameFromString(game)); if (pkm.IsLegal()) { return(NoContent()); } throw new LegalityException("Pokemon couldn't be legalized!"); }
public async Task <IActionResult> GetPokemonFromShowdown([FromRoute] string game, [FromBody, Required] PokemonShowdownRequest body) { var pkm = await PokemonService.GetPokemonFromShowdown(body.ShowdownSet, GetGameFromString(game)); return(await ReturnPokemonFile(pkm, IsEncryptionWanted)); }