need help about revalidateTag() function
Unanswered
Cuvier’s Dwarf Caiman posted this in #help-forum
Cuvier’s Dwarf CaimanOP
i use two times revalidateTag function for revalidating two different fetch requests but its not revalidating
how can i revalidate two diffrerent fetch requests next.tags
export async function connectImageToProductAction({ imageId, productId }: { imageId: string, productId: string }) {
try {
await prisma.images.update({
data: {
Products: {
connect: {
id: productId
}
}
},
where: {
id: imageId
}
})
revalidateTag("product-form-images")
revalidateTag("images-for-gadget")
console.log("Successfully connected image with product ðŸ‘")
} catch (e) {
console.log("Something went wrong when connecting image to production 👎")
console.log(e)
}
}
how can i revalidate two diffrerent fetch requests next.tags
export async function connectImageToProductAction({ imageId, productId }: { imageId: string, productId: string }) {
try {
await prisma.images.update({
data: {
Products: {
connect: {
id: productId
}
}
},
where: {
id: imageId
}
})
revalidateTag("product-form-images")
revalidateTag("images-for-gadget")
console.log("Successfully connected image with product ðŸ‘")
} catch (e) {
console.log("Something went wrong when connecting image to production 👎")
console.log(e)
}
}