strudel-science / strudel-kit

Frontend React templates for implementing scientific UIs with the STRUDEL design system.
https://strudel.science/strudel-kit/docs
Other
8 stars 3 forks source link

Connect detail page to /occurence/{gbifId} endpoint #99

Closed codytodonnell closed 1 week ago

codytodonnell commented 4 months ago

Right now, the detail page, [id].tsx , that shows when you drill into a preview panel uses data from the originally fetched list of items from the explore page. This would cause problems if you loaded a detail page on its own, without first loading the explore page. Instead, we want the detail page to fetch a single record of data when it loads. The record it fetches should be based on the id in the URL. If we load the page /explore-data/3, we should fetch the occurrence with the id (or key) of 3.

Specifically, what we want to do is replace the function that populates the entity variable with a new fetch request to the /occurrence/{gbifId} endpoint of the API. Here's an example of that endpoint for key=4514082304:

https://api.gbif.org/v1/occurrence/4514082304