Add TODO for removing unnecessary endpoints
parent
a831e76275
commit
5fee30437b
|
@ -115,6 +115,7 @@ describe('pokedexApi', () => {
|
||||||
expect(pokemonListData?.previous).toBeUndefined();
|
expect(pokemonListData?.previous).toBeUndefined();
|
||||||
});
|
});
|
||||||
|
|
||||||
|
// TODO: decide whether remove these test handlers, as logic of getting Pokemon List for a Region is no longer correct
|
||||||
test('query getRegionPokemonList for johto should return correct data in list', async () => {
|
test('query getRegionPokemonList for johto should return correct data in list', async () => {
|
||||||
await store.dispatch(
|
await store.dispatch(
|
||||||
pokedexApi.endpoints.getRegionPokemonList.initiate('johto'),
|
pokedexApi.endpoints.getRegionPokemonList.initiate('johto'),
|
||||||
|
|
|
@ -66,6 +66,7 @@ export const pokedexApi = createApi({
|
||||||
getArea: builder.query<AreaResponseData, number | string>({
|
getArea: builder.query<AreaResponseData, number | string>({
|
||||||
query: IdOrName => ({ url: `location-area/${IdOrName}` }),
|
query: IdOrName => ({ url: `location-area/${IdOrName}` }),
|
||||||
}),
|
}),
|
||||||
|
// TODO: decide whether remove this endpoint, as logic of getting PokemonList for a region is no longer correct
|
||||||
getRegionPokemonList: builder.query<PokemonListItem[], number | string>({
|
getRegionPokemonList: builder.query<PokemonListItem[], number | string>({
|
||||||
async queryFn(regionIdOrName, api) {
|
async queryFn(regionIdOrName, api) {
|
||||||
api.dispatch(setFetchingRegionPokemonList(true));
|
api.dispatch(setFetchingRegionPokemonList(true));
|
||||||
|
|
|
@ -42,6 +42,7 @@ export const handlers = [
|
||||||
}),
|
}),
|
||||||
|
|
||||||
// getRegionPokemonList
|
// getRegionPokemonList
|
||||||
|
// TODO: decide whether remove these test handlers, as logic of getting Pokemon List for a Region is no longer correct
|
||||||
rest.get('https://pokeapi.co/api/v2/region/johto', (req, res, ctx) => {
|
rest.get('https://pokeapi.co/api/v2/region/johto', (req, res, ctx) => {
|
||||||
return res(ctx.json(region_johto));
|
return res(ctx.json(region_johto));
|
||||||
}),
|
}),
|
||||||
|
|
Loading…
Reference in New Issue