monaco-editor-lsp-next/src/app/(protected)/dashboard/usermanagement/_actions/problemActions.ts

14 lines
463 B
TypeScript
Raw Normal View History

2025-06-21 09:44:14 +00:00
'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')
}