api
This commit is contained in:
@@ -31,6 +31,16 @@ app.MapGet("/pokemons/{id}", (int id) =>
|
|||||||
return Results.Ok(pokemon);
|
return Results.Ok(pokemon);
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
|
app.MapGet("/pokemons/type", (string type) =>
|
||||||
|
{
|
||||||
|
var filterpokemon = pokemons.FirstOrDefault(p => p.Type == type);
|
||||||
|
if (filterpokemon == null)
|
||||||
|
{
|
||||||
|
return Results.NotFound();
|
||||||
|
}
|
||||||
|
|
||||||
|
return null;
|
||||||
|
});
|
||||||
|
|
||||||
List<string> Validate(PokemonInput input)
|
List<string> Validate(PokemonInput input)
|
||||||
{
|
{
|
||||||
|
|||||||
Reference in New Issue
Block a user