|
|
|
@ -256,7 +256,7 @@ app.post('/problem/:id/edit', async (req, res) => {
|
|
|
|
|
} |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
if (!req.body.trim()) throw new ErrorMessage('题目名不能为空。'); |
|
|
|
|
if (!req.body.title.trim()) throw new ErrorMessage('题目名不能为空。'); |
|
|
|
|
problem.title = req.body.title; |
|
|
|
|
problem.description = req.body.description; |
|
|
|
|
problem.input_format = req.body.input_format; |
|
|
|
@ -345,7 +345,7 @@ app.post('/problem/:id/import', async (req, res) => {
|
|
|
|
|
|
|
|
|
|
if (!json.success) throw new ErrorMessage('题目加载失败。', null, json.error); |
|
|
|
|
|
|
|
|
|
if (!json.obj.trim()) throw new ErrorMessage('题目名不能为空。'); |
|
|
|
|
if (!json.obj.title.trim()) throw new ErrorMessage('题目名不能为空。'); |
|
|
|
|
problem.title = json.obj.title; |
|
|
|
|
problem.description = json.obj.description; |
|
|
|
|
problem.input_format = json.obj.input_format; |
|
|
|
|