I have this code
const redirectToPayment = async () => {
const { data } = await useAsyncQuery(
createCheckoutMutation,
{ variantId: product.value.productByHandle.variants.edges[0].node.id
});
window.location.href = data.value.checkoutCreate.checkout.webUrl;
}
I am getting the next warning
[nuxt] [useAsyncData] Component is already mounted, please use $fetch instead. See https://nuxt.com/docs/getting-started/data-fetching
I’ve been searching and reading and it seems the solution it’s here, but I can’t make it work in my example.
Could anyone help me?
Thanks