core: config: refactor (allow schemastery)

This commit is contained in:
undefined committed 2025-03-07 11:59:13 +08:00
1 parent f825fbe4f1
commit 31b4ed73f4
16 files changed
+373 -220

No files matched your search

+2 -2
View File
@@ -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;
}
}