mirror of
https://gitcode.com/gh_mirrors/hy/Hydro.git
synced 2026-10-19 17:38:19 +08:00
core: config: refactor (allow schemastery)
This commit is contained in:
16 files changed
+373
-220
No files matched your search
@@ -1,7 +1,7 @@
|
||||
/* eslint-disable global-require */
|
||||
import {
|
||||
ContestModel, Context, Handler, ObjectId, param, PERM, PRIV, ProblemModel, Schema,
|
||||
SettingModel, SystemModel, SystemSettings, Types, UserModel,
|
||||
SettingModel, SystemModel, Types, UserModel,
|
||||
} from 'hydrooj';
|
||||
import convert from 'schemastery-jsonschema';
|
||||
import markdown from './backendlib/markdown';
|
||||
@@ -74,7 +74,7 @@ class MarkdownHandler extends Handler {
|
||||
|
||||
class SystemConfigSchemaHandler extends Handler {
|
||||
async get() {
|
||||
const schema = convert(Schema.intersect(SystemSettings) as any, true);
|
||||
const schema = convert(Schema.intersect(this.ctx.config.settings) as any, true);
|
||||
this.response.body = schema;
|
||||
}
|
||||
}
|
||||
|
||||
Reference in new issue
Block a user