Get data from REST API in templates
- Dominant language
- JavaScript
- Stars
- 8.5k
- Forks
- 466
- PR merge metrics
- No merged PRs in 30d
Description
I read issue #928 but can't get any solution.
My structure is very simple. I add my categories to grapql from json. And when visitor visit category page, they'll see photos gathered from REST api with category id.
I add axios.get(url) to mounted of templates/categories file. When clicked link to see category, there is no problem. Photos requested from API and showed. But clicked another category to get photos, it never works. Photos remain same.
It is a simple question but I can't find detailed information that shows the best practise.
Contributor guide
No contributing guide indexed for this repository
Research direction
Start by reading issue #928 and inspecting the axios.get call in templates/categories, then reproduce the problem by navigating between category links. Confirm that the photos update for each selected category rather than remaining from the first visit.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- graphql, javascript
- Domain
- api, frontend
- Issue type
- Bug
- Difficulty
- 3/5
- Estimated time
- 1-2 days
- Activity status
- Stale
- Clarity
- Needs clarification
- Newbie friendliness
- 30/100