mirror of
https://github.com/cfngc4594/monaco-editor-lsp-next.git
synced 2025-07-04 17:30:52 +00:00
18 lines
480 B
TypeScript
18 lines
480 B
TypeScript
"use server";
|
|
|
|
import prisma from "@/lib/prisma";
|
|
import { revalidatePath } from "next/cache";
|
|
import type { Problem } from "@/generated/client";
|
|
|
|
export async function createProblem(
|
|
data: Omit<Problem, "id" | "createdAt" | "updatedAt">
|
|
) {
|
|
await prisma.problem.create({ data });
|
|
revalidatePath("/usermanagement/problem");
|
|
}
|
|
|
|
export async function deleteProblem(id: string) {
|
|
await prisma.problem.delete({ where: { id } });
|
|
revalidatePath("/usermanagement/problem");
|
|
}
|