Dental Care
This commit is contained in:
18
app/(main)/admin/action.ts
Normal file
18
app/(main)/admin/action.ts
Normal file
@@ -0,0 +1,18 @@
|
||||
"use server";
|
||||
|
||||
import { getServerSession } from "@/lib/auth-session/get-session";
|
||||
import { forbidden, unauthorized } from "next/navigation";
|
||||
import { setTimeout } from "node:timers/promises";
|
||||
|
||||
export async function deleteApplication() {
|
||||
const session = await getServerSession();
|
||||
const user = session?.user;
|
||||
|
||||
if (!user) unauthorized();
|
||||
|
||||
if (user.role !== "admin") forbidden();
|
||||
|
||||
// Delete app...
|
||||
|
||||
await setTimeout(800);
|
||||
}
|
||||
Reference in New Issue
Block a user