Opening details page from a list

I have a page (products.html) with a list of products (framework7 media list).
When I click on an item in the list I update a session variable with the unique ID and open a details page (product.html via a route). On the details page I have an API call with loads the specific product data.
This works fine BUT, if I click back to the products listing and pick a different product, the details page doesn’t update to show the new information (it shows the product I initially picked).
The session variable is being changed (according to Chrome dev tools) but I need to force a reload or similar.
How should I do this?

Welcome to the community Paul! :slight_smile:

The way that I handle this is to use an API call within a Server Action rather than on the page itself… so when your user clicks on another product it runs the server connnect / server action “get_product” which returns all the data your user requires.

If you want to do this via an API call on the page then you’d need to make a call to that API part of what is executed using the on-click action of whatever is clicked to pick a different product.

I hope I’ve understood correctly and that input helps!

Best wishes,

HI Anthony, thanks for the reply and the welcome.
I don’t have any server actions as all the data is via an API.
So is it possible to call an API on another page (the details page is separate from the listing, where the item is picked)?
I have been trying to figure out a way of refreshing the data on the details page but can’t find where that might be (the load action doesn’t seem to do anything) as the page has been loaded once (first item view).
Cheers, Paul.