'Fetching two different APIS on two differents routes originating from same route in React

So far I implemented a route (url "/") that fetches all data from an API (5000 objects) and shows for each of those an own card (m-ui).

When I click on a button in one of those card, I am forwarded to another route ("/card/id) which shows specific properties of the respective card

Going back to ("/"), I would like to implement that when I click on another button in the card, I get forwarded to a route ("/post/id") which also shows specific data, but from another API.

However, so far I couldn't manage to fetch any data from that new API and when I click on mentioned button, I just get a blank page and a console which doesn't do anything.

Displayed how I want the routing to work in a diagramm, it would look like his:

API A --> API A/id API A --> API B/id

In hope this was comprehensible, I would appreciate any hint. Maybe I am missing some basic functionality of routes. Thank you.



Sources

This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.

Source: Stack Overflow

Solution Source