useFetch update my data without assignment
Hi guys,
I must have missed something, but I found something weird using useFetch.
It looks like there's a kind of link between requests on the same URL.
Here's my code for an example:
On the first load, my page shows
Test: { "test": "get" }
, that is what I wanted to do, fine.
But when I click on the button, the page shows Test: { "test": "post" }
and I don't understand why.
I expected to see Test: { "test": "get" }
again, as I didn't change the test
variable by myself.
Any idea?
Thanks2 Replies
maybe you want $fetch i use "useFetch" only for the first call
https://discord.com/channels/473401852243869706/1075465297974263868
Ok I wanted to factorize all my API calls into a custom plugin to add them some options.
But I assume that I just have to make a .get() function using
useFetch
, and post, put etc using $fetch
?