diff --git a/web/src/lib/revalidate.ts b/web/src/lib/revalidate.ts new file mode 100644 index 00000000..247dc7ff --- /dev/null +++ b/web/src/lib/revalidate.ts @@ -0,0 +1,22 @@ +"use server" + +import { revalidatePath, revalidateTag } from "next/cache" + +/** + * Revalidate the community page cache + * Can be called from server actions after submission approval/rejection + */ +export async function revalidateCommunityPage() { + revalidatePath("/community") + revalidateTag("community-gallery") +} + +/** + * Revalidate all submission-related caches + */ +export async function revalidateSubmissions() { + revalidateTag("community-gallery") + revalidatePath("/community") + revalidatePath("/dashboard") +} +