mirror of
https://gitcode.com/gh_mirrors/hy/Hydro.git
synced 2026-10-17 17:36:08 +08:00
core: fix problem edit without pid change
This commit is contained in:
1 parent
dcf949dc7a
commit
006f969de6
2 files changed
+2
-2
No files matched your search
@@ -1,6 +1,6 @@
|
||||
{
|
||||
"name": "hydrooj",
|
||||
"version": "2.20.5",
|
||||
"version": "2.20.6",
|
||||
"bin": "bin/hydrooj.js",
|
||||
"main": "dist/loader.js",
|
||||
"typings": "dist/loader.d.ts",
|
||||
|
||||
@@ -328,7 +328,7 @@ export class ProblemEditHandler extends ProblemManageHandler {
|
||||
try {
|
||||
content = JSON.parse(content);
|
||||
} catch { /* Ignore */ }
|
||||
if (await problem.get(domainId, newPid)) throw new BadRequestError('new pid exists');
|
||||
if (newPid !== this.pdoc.pid && await problem.get(domainId, newPid)) throw new BadRequestError('new pid exists');
|
||||
const $update: Partial<Pdoc> = {
|
||||
title, content, pid: newPid, hidden, tag,
|
||||
};
|
||||
|
||||
Reference in new issue
Block a user