This repository has been archived on 2026-09-03. You can view files and clone it. You cannot open issues or pull requests or push a commit.
Files
confessions-of-grace/app/admin/(dashboard)/comments/actions.ts
T
2026-02-20 09:12:47 -06:00

17 lines
411 B
TypeScript

"use server";
import { createClient } from "@/utils/supabase/server";
import { revalidatePath } from "next/cache";
export async function deleteComment(id: number) {
const supabase = await createClient();
const { error } = await supabase.from("comments").delete().eq("id", id);
if (error) {
throw new Error(`Failed to delete comment: ${error.message}`);
}
revalidatePath("/admin/comments");
}