import { getSupabaseAdminClient } from "@/lib/supabase/admin"; /** Delete a group and all associated data (members, movies). */ export async function deleteGroupAndData(groupId: string): Promise { const admin = getSupabaseAdminClient(); await Promise.all([ admin.from("group_members").delete().eq("group_id", groupId), admin.from("movies").delete().eq("group_id", groupId), ]); const { error } = await admin.from("groups").delete().eq("id", groupId); if (error) throw error; }