diff --git a/app/actions/form.ts b/app/actions/form.ts index ebf4841..b88bedd 100644 --- a/app/actions/form.ts +++ b/app/actions/form.ts @@ -54,6 +54,6 @@ export async function deleteForm(id: string) { } await db.delete(forms).where(eq(forms.id, id)); - revalidatePath("/form/admin"); - redirect("/form/admin"); + revalidatePath("/admin/form"); + redirect("/admin/form"); } diff --git a/app/admin/form/page.tsx b/app/admin/form/page.tsx index 1c77dfc..7c3016f 100644 --- a/app/admin/form/page.tsx +++ b/app/admin/form/page.tsx @@ -11,8 +11,9 @@ import { TableRow, } from "@/components/ui/table"; import { Badge } from "@/components/ui/badge"; -import { Plus } from "lucide-react"; +import { Plus, Trash2 } from "lucide-react"; import { redirect } from "next/navigation"; +import { deleteForm } from "@/app/actions/form"; export const dynamic = "force-dynamic"; @@ -83,6 +84,11 @@ export default async function AdminFormsPage() { +
))