Piskr
API and routing
Hey, so I have a project that I'm trying to fix. The problem I have is that I've now enabled storing my API token to a cookie and now my data fetching is completely borked.
In the normal use-case the user logs into the app receives the token and stores it into a session cookie. Then it fetches tons of data from the API and displays a data-table. Each row of the table can then route you to the details page of the row. So the first URL would be: localhost:3000, and then the details page would be:
localhost:3000/subscriber?id=22392. In this use-case it works fine, but now sometimes my users would send links around, so when a user sends the link localhost:3000/subscriber?id=22392, now suddenly the store is empty and I need to refetch my data, which in the first usecase works no problem, while in this case, none of the fetches are executed.
I've used this article to set-up my fetching factory:
https://medium.com/@luizzappa/nuxt-3-repository-pattern-organising-and-managing-your-calls-to-apis-with-typescript-acd563a4e046
I'll try to provide more info, but I cant provide the API access...
1 replies