fix: wrong base case
This commit is contained in:
+1
-1
@@ -197,7 +197,7 @@ export async function createApiRouter() {
|
||||
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, {
|
||||
title: req.body.title ?? `Problema ${problemNextId}`,
|
||||
|
||||
Reference in New Issue
Block a user