File tree Expand file tree Collapse file tree 1 file changed +4
-4
lines changed
Roadmap/20 - PETICIONES HTTP/typescript Expand file tree Collapse file tree 1 file changed +4
-4
lines changed Original file line number Diff line number Diff line change @@ -93,7 +93,7 @@ class Pokemon {
93
93
}
94
94
95
95
class Fetcher {
96
- static async customFetch < T > ( endpoint : string ) : Promise < T > {
96
+ static async get < T > ( endpoint : string ) : Promise < T > {
97
97
const response = await fetch ( endpoint ) ;
98
98
const data = ( await response . json ( ) ) as T ;
99
99
return data ;
@@ -106,23 +106,23 @@ class PokemonFetcher {
106
106
static async fetchPokemonInformation (
107
107
pokemonTarget : string
108
108
) : Promise < PokemonResponse > {
109
- return await Fetcher . customFetch < PokemonResponse > (
109
+ return await Fetcher . get < PokemonResponse > (
110
110
`${ this . baseUrl } pokemon/${ pokemonTarget } `
111
111
) ;
112
112
}
113
113
114
114
static async fetchPokemonSpecies (
115
115
pokemonTarget : string
116
116
) : Promise < PokemonSpeciesResponse > {
117
- return await Fetcher . customFetch < PokemonSpeciesResponse > (
117
+ return await Fetcher . get < PokemonSpeciesResponse > (
118
118
`${ this . baseUrl } pokemon-species/${ pokemonTarget } `
119
119
) ;
120
120
}
121
121
122
122
static async fetchPokemonEvolutionFromURL (
123
123
evolutionURL : string
124
124
) : Promise < PokemonEvolutionResponse > {
125
- return await Fetcher . customFetch < PokemonEvolutionResponse > ( evolutionURL ) ;
125
+ return await Fetcher . get < PokemonEvolutionResponse > ( evolutionURL ) ;
126
126
}
127
127
}
128
128
You can’t perform that action at this time.
0 commit comments