|
|
@ -53,9 +53,11 @@ app.get('/contest/:id/edit', async (req, res) => { |
|
|
|
let contest = await Contest.fromID(contest_id); |
|
|
|
let contest = await Contest.fromID(contest_id); |
|
|
|
if (!contest) { |
|
|
|
if (!contest) { |
|
|
|
contest = await Contest.create(); |
|
|
|
contest = await Contest.create(); |
|
|
|
|
|
|
|
contest.id = 0; |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
let problems = await contest.problems.split('|').mapAsync(async id => await Problem.fromID(id)); |
|
|
|
let problems = []; |
|
|
|
|
|
|
|
if (contest.problems) problems = await contest.problems.split('|').mapAsync(async id => await Problem.fromID(id)); |
|
|
|
|
|
|
|
|
|
|
|
res.render('edit_contest', { |
|
|
|
res.render('edit_contest', { |
|
|
|
contest: contest, |
|
|
|
contest: contest, |
|
|
|