12 lines
220 B
TypeScript
12 lines
220 B
TypeScript
|
"use server"
|
||
|
import { revalidatePath } from "next/cache"
|
||
|
export default async function revalidate(path: string) {
|
||
|
try {
|
||
|
revalidatePath(path)
|
||
|
return true
|
||
|
} catch (error) {
|
||
|
console.error(error)
|
||
|
return false
|
||
|
}
|
||
|
}
|