(problemId: string, data: Problem)
| 78 | } |
| 79 | |
| 80 | export async function updateProblem(problemId: string, data: Problem) { |
| 81 | try { |
| 82 | const problem = await db.problem.update({ |
| 83 | where: { |
| 84 | id: problemId, |
| 85 | }, |
| 86 | data, |
| 87 | }); |
| 88 | return problem; |
| 89 | } catch (e) { |
| 90 | return null; |
| 91 | } |
| 92 | } |
| 93 | |
| 94 | export async function createProblem(data: Omit<Problem, "id">) { |
| 95 | try { |