Remove redundant code in pokeApi.ts

develop
Jason Zhu 2023-05-19 18:37:17 +10:00
parent c7d7db22da
commit 7bb4fde73e
1 changed files with 0 additions and 20 deletions

View File

@ -9,10 +9,7 @@ import {
PokemonResponseData,
EvolutionChainResponseData,
PokemonSpeciesResponseData,
EvolutionChain,
} from 'types/api';
import { InfoDialogComponentProps } from 'components/InfoDialogComponent';
import { EvolutionSpeciesProps } from 'components/EvolutionSpecies';
export interface pokeApiFullListFetchArgs extends FetchArgs {
fetchAllPages?: boolean;
@ -48,23 +45,6 @@ async function fetchAllPages(url: string | null) {
return allResults;
}
export const convertEvolutionChainResponseDataToEvolutionSpeciesProps = (
evo: EvolutionChainResponseData,
): EvolutionSpeciesProps[] => {
const result: EvolutionSpeciesProps[] = [];
// const addEvolutionSpeciesProps = (evo: EvolutionChain, level: number) => {
// result.push({
// name: evo.species.name,
// });
// evo.evolves_to.forEach(evo => {
// addEvolutionSpeciesProps(evo, level + 1);
// });
// };
//
// addEvolutionSpeciesProps(evo.chain, 0);
return result;
};
export const paginationBaseQuery = (baseUrl: string) =>
fetchBaseQuery({ baseUrl });