|
|
@ -197,7 +197,7 @@ export async function createApiRouter() {
|
|
|
|
return
|
|
|
|
return
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
const problemNextId = (await getProblems(db)).map(p => parseInt(p.id)).reduce((acc, v) => Math.max(acc, v), 1) + 1
|
|
|
|
const problemNextId = (await getProblems(db)).map(p => parseInt(p.id)).reduce((acc, v) => Math.max(acc, v), 0) + 1
|
|
|
|
|
|
|
|
|
|
|
|
const id = await createProblem(db, {
|
|
|
|
const id = await createProblem(db, {
|
|
|
|
title: req.body.title ?? `Problema ${problemNextId}`,
|
|
|
|
title: req.body.title ?? `Problema ${problemNextId}`,
|
|
|
|