Add TODO for removing unnecessary endpoints
parent
a831e76275
commit
5fee30437b
|
@ -115,6 +115,7 @@ describe('pokedexApi', () => {
|
|||
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 () => {
|
||||
await store.dispatch(
|
||||
pokedexApi.endpoints.getRegionPokemonList.initiate('johto'),
|
||||
|
|
|
@ -66,6 +66,7 @@ export const pokedexApi = createApi({
|
|||
getArea: builder.query<AreaResponseData, number | string>({
|
||||
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>({
|
||||
async queryFn(regionIdOrName, api) {
|
||||
api.dispatch(setFetchingRegionPokemonList(true));
|
||||
|
|
|
@ -42,6 +42,7 @@ export const handlers = [
|
|||
}),
|
||||
|
||||
// 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) => {
|
||||
return res(ctx.json(region_johto));
|
||||
}),
|
||||
|
|
Loading…
Reference in New Issue