Request response not updated
Hi need some help after I successfully login using this module
https://nuxt.com/modules/nuxt-auth-sanctum
when I first click the button to get book, it works fine I can see the response text book1, now I edited the laravelbacend api response to book2, when I click again the button it will still return book1, I am confused why the response is not updating. when I restart my docker and request again I can see now the response book2.
Note:
- Before I restart the container I exec the container and I can see the api text is book2, meaning my edited file is successfully sync to the container.
here is my code . I just log it to console.
Thank you in advance
2 Replies
Try this:
const { data, execute: getBook } = await useFetch('https://mysite.local/api/books', {
lazy: true,
server: false,
immediate: false,
watch: false,
credentials: "include",
onResponse({ response }) {
console.log(response._data)
}
});
Example: https://stackblitz.com/edit/github-otdq9z?file=app.vueHi , thank you I fixed my problem it is on my server side.