mirror of
https://github.com/cfngc4594/monaco-editor-lsp-next.git
synced 2025-07-05 02:00:52 +00:00
14 lines
463 B
TypeScript
14 lines
463 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')
|
|
}
|