first
This commit is contained in:
commit
8538ab969a
434 changed files with 44051 additions and 0 deletions
15
apps/web/modules/shared/lib/cache.ts
Normal file
15
apps/web/modules/shared/lib/cache.ts
Normal file
|
|
@ -0,0 +1,15 @@
|
|||
"use server";
|
||||
|
||||
import { revalidatePath } from "next/cache";
|
||||
|
||||
export const clearCache = async (path?: string) => {
|
||||
try {
|
||||
if (path) {
|
||||
revalidatePath(path);
|
||||
} else {
|
||||
revalidatePath("/", "layout");
|
||||
}
|
||||
} catch (error) {
|
||||
console.error("Could not revalidate path", path, error);
|
||||
}
|
||||
};
|
||||
Loading…
Add table
Add a link
Reference in a new issue