I am stuck on an issue. Let's say I have a home page. From this home page, I want to route to either page A or page B.

I have a list of items on the home page and what I need to do is when I click on any item in the list, it makes a GET API call, and based on one field in the response which is a boolean, I either need to redirect to page A or page B.

Basically, I need to call an API on the click of the item and get the response before it is routed to either Page A or Page B.

Many thanks in advance