N
Nuxt4mo ago
marz

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.
const getBook = () => {

const data = useFetch('https://mysite.local/api/books',{
credentials: "include",
method: "GET",
});


console.log(data);
}
const getBook = () => {

const data = useFetch('https://mysite.local/api/books',{
credentials: "include",
method: "GET",
});


console.log(data);
}
Thank you in advance
Nuxt
Nuxt-auth-sanctum · Nuxt Modules
Nuxt module for Laravel Sanctum authentication
2 Replies
oneeach
oneeach4mo ago
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.vue
marz
marzOP4mo ago
Hi , thank you I fixed my problem it is on my server side.
Want results from more Discord servers?
Add your server