revalidateTag for non fetch functions like prisma #52854
Unanswered
alsherif-khalaf
asked this question in
App Router
Replies: 2 comments 1 reply
-
|
The only way I could get it to work was by using route handlers, and then I added the prisma logic in there. Here is an example where I'm using fetch to an API route: async function getProfileByUserId(id: string ) {
const url = `${basePath}/api/read/profile/getProfileByUserId?id=${id}`
const res = await fetch(url, { next: { tags: ["user"] } })
return res.json()
}If you found a better way, please let me know. |
Beta Was this translation helpful? Give feedback.
0 replies
-
|
Check out |
Beta Was this translation helpful? Give feedback.
1 reply
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
-
How can I tag this function for example :
like this :
to use it via revalidateTag('tag') ?
Beta Was this translation helpful? Give feedback.
All reactions