I am not really sure why this problem occurs. first and foremost, if I have useFetch in my <script setup> it sends roughly 7 requests to my API and returns the latests result. I would like to only send one request.
I also wanted to see what happens when I turn off the API and try to use useFetch, it then sent 15k requests until I gut a heap limit allocation failure.
this is how I use useFetch()
const {data, pending, refresh, error} = await useFetch<TestResult>('http://localhost:3000/test', {
method: 'POST',
body: JSON.stringify(body),
async onRequest(context) {
console.log("sent a request");
},
onResponseError(context) {
},
});```
I have tried to find threads on this in both forums and docs but can't find anything, so any help is appreaciated. My goal is to just send 1 request and then be able to send another one with the refresh function, however that also does not seem to work. Whenever I use the refresh function only pending gets set to true but no more requests are sent unforutnately. This is by button
```html
<v-btn :loading="pending" :disabled="pending" @click="refresh"></v-btn>
Thanks in advance!