mirror of
https://gitcode.com/gh_mirrors/hy/Hydro.git
synced 2026-10-17 09:36:08 +08:00
core: fix ProblemDetail.get
This commit is contained in:
1 parent
e5ed861f1b
commit
15d2ecaf54
4 files changed
+10
-5
No files matched your search
+2
-2
@@ -19,8 +19,8 @@ dist/
|
||||
globalConfig.json
|
||||
|
||||
# Config Files
|
||||
config.yaml
|
||||
config.json
|
||||
/config.yaml
|
||||
/config.json
|
||||
yarn.lock
|
||||
tsconfig.json
|
||||
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
{
|
||||
"name": "hydrooj",
|
||||
"version": "2.13.12",
|
||||
"version": "2.13.13",
|
||||
"bin": "bin/hydrooj.js",
|
||||
"main": "dist/loader.js",
|
||||
"typings": "dist/loader.d.ts",
|
||||
|
||||
@@ -189,6 +189,8 @@ class ProblemDetailHandler extends ProblemHandler {
|
||||
};
|
||||
}
|
||||
|
||||
async get(...args: any[]) { } // eslint-disable-line
|
||||
|
||||
@param('pid', Types.UnsignedInt)
|
||||
@param('dest', Types.String)
|
||||
@param('hidden', Types.Boolean)
|
||||
@@ -391,9 +393,11 @@ class ProblemSettingsHandler extends ProblemManageHandler {
|
||||
}
|
||||
if (!difficultyAdmin) difficultyAdmin = null;
|
||||
else if (difficultyAdmin < 1 || difficultyAdmin > 9) throw new ValidationError('difficultyAdmin');
|
||||
await problem.edit(domainId, pdoc.docId, {
|
||||
const update: Partial<Pdoc> = {
|
||||
hidden, category, tag, difficultySetting, difficultyAdmin,
|
||||
});
|
||||
};
|
||||
await bus.serial('problem/setting', update, this);
|
||||
await problem.edit(domainId, pdoc.docId, update);
|
||||
await global.Hydro.script.difficulty.run({ domainId, pid }, console.log);
|
||||
this.back();
|
||||
}
|
||||
|
||||
@@ -43,6 +43,7 @@ export interface EventMap {
|
||||
|
||||
'problem/edit': (doc: Pdoc) => VoidReturn
|
||||
'problem/list': (query: FilterQuery<Pdoc>, handler: any) => VoidReturn
|
||||
'problem/setting': (update: Partial<Pdoc>, handler: any) => VoidReturn
|
||||
'problem/get': (doc: Pdoc, handler: any) => VoidReturn
|
||||
|
||||
'record/change': (rdoc: Rdoc, $set?: any, $push?: any) => void
|
||||
|
||||
Reference in new issue
Block a user