mirror of
https://gitcode.com/gh_mirrors/hy/Hydro.git
synced 2026-10-19 17:38:19 +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",
|
"name": "hydrooj",
|
||||||
"version": "2.20.5",
|
"version": "2.20.6",
|
||||||
"bin": "bin/hydrooj.js",
|
"bin": "bin/hydrooj.js",
|
||||||
"main": "dist/loader.js",
|
"main": "dist/loader.js",
|
||||||
"typings": "dist/loader.d.ts",
|
"typings": "dist/loader.d.ts",
|
||||||
|
|||||||
@@ -328,7 +328,7 @@ export class ProblemEditHandler extends ProblemManageHandler {
|
|||||||
try {
|
try {
|
||||||
content = JSON.parse(content);
|
content = JSON.parse(content);
|
||||||
} catch { /* Ignore */ }
|
} 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> = {
|
const $update: Partial<Pdoc> = {
|
||||||
title, content, pid: newPid, hidden, tag,
|
title, content, pid: newPid, hidden, tag,
|
||||||
};
|
};
|
||||||
|
|||||||
Reference in new issue
Block a user