All checks were successful
Vercel Preview Deployment / Deploy-Preview (push) Successful in 1m19s
added delete button to all categories.
11 lines
298 B
TypeScript
11 lines
298 B
TypeScript
"use server";
|
|
import { eq } from "drizzle-orm";
|
|
import { db } from "../db";
|
|
import { regions } from "../db/schema";
|
|
import { revalidatePath } from "next/cache";
|
|
|
|
export default async function deleteRegion(id: string) {
|
|
await db.delete(regions).where(eq(regions.id, id));
|
|
revalidatePath("/");
|
|
}
|