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)/subscriptions/actions.ts
T
2026-02-20 09:12:47 -06:00

20 lines
446 B
TypeScript

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