mirror of
https://gitcode.com/gh_mirrors/hy/Hydro.git
synced 2026-10-20 01:38:19 +08:00
core: update vnode selection
This commit is contained in:
1 parent
7377bfadb0
commit
8ae067239c
5 files changed
+9
-4
No files matched your search
@@ -1,6 +1,6 @@
|
|||||||
{
|
{
|
||||||
"name": "hydrooj",
|
"name": "hydrooj",
|
||||||
"version": "2.32.34",
|
"version": "2.32.35",
|
||||||
"bin": "bin/hydrooj.js",
|
"bin": "bin/hydrooj.js",
|
||||||
"main": "src/loader",
|
"main": "src/loader",
|
||||||
"module": "src/loader",
|
"module": "src/loader",
|
||||||
|
|||||||
@@ -159,7 +159,7 @@ class DiscussionCreateHandler extends DiscussionHandler {
|
|||||||
if (highlight) this.checkPerm(PERM.PERM_HIGHLIGHT_DISCUSSION);
|
if (highlight) this.checkPerm(PERM.PERM_HIGHLIGHT_DISCUSSION);
|
||||||
if (pin) this.checkPerm(PERM.PERM_PIN_DISCUSSION);
|
if (pin) this.checkPerm(PERM.PERM_PIN_DISCUSSION);
|
||||||
const did = await discussion.add(
|
const did = await discussion.add(
|
||||||
domainId, typeMapper[type], this.vnode.docId, this.user._id,
|
domainId, typeMapper[type], this.vnode.id, this.user._id,
|
||||||
title, content, this.request.ip, highlight, pin,
|
title, content, this.request.ip, highlight, pin,
|
||||||
);
|
);
|
||||||
this.response.body = { did };
|
this.response.body = { did };
|
||||||
|
|||||||
@@ -12,7 +12,11 @@ class NotFoundHandler extends Handler {
|
|||||||
throw new NotFoundError(this.request.path);
|
throw new NotFoundError(this.request.path);
|
||||||
}
|
}
|
||||||
|
|
||||||
all() { }
|
get() { }
|
||||||
|
post() { }
|
||||||
|
head() { }
|
||||||
|
put() { }
|
||||||
|
delete() { }
|
||||||
}
|
}
|
||||||
|
|
||||||
export async function apply() {
|
export async function apply() {
|
||||||
|
|||||||
@@ -126,6 +126,7 @@ export class ProblemMainHandler extends ProblemHandler {
|
|||||||
for (const pid of pids) {
|
for (const pid of pids) {
|
||||||
// eslint-disable-next-line no-await-in-loop
|
// eslint-disable-next-line no-await-in-loop
|
||||||
const pdoc = await problem.get(domainId, pid);
|
const pdoc = await problem.get(domainId, pid);
|
||||||
|
if (!pdoc) continue;
|
||||||
if (!this.user.own(pdoc, PERM.PERM_EDIT_PROBLEM_SELF)) this.checkPerm(PERM.PERM_EDIT_PROBLEM);
|
if (!this.user.own(pdoc, PERM.PERM_EDIT_PROBLEM_SELF)) this.checkPerm(PERM.PERM_EDIT_PROBLEM);
|
||||||
// eslint-disable-next-line no-await-in-loop
|
// eslint-disable-next-line no-await-in-loop
|
||||||
await problem.del(domainId, pid);
|
await problem.del(domainId, pid);
|
||||||
|
|||||||
@@ -696,7 +696,7 @@ async function handle(ctx, HandlerClass, checker) {
|
|||||||
} else if (typeof h.post !== 'function') {
|
} else if (typeof h.post !== 'function') {
|
||||||
throw new MethodNotAllowedError(method);
|
throw new MethodNotAllowedError(method);
|
||||||
}
|
}
|
||||||
} else if (typeof h[method] !== 'function' && typeof h.all !== 'function') {
|
} else if (typeof h[method] !== 'function') {
|
||||||
throw new MethodNotAllowedError(method);
|
throw new MethodNotAllowedError(method);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
Reference in new issue
Block a user