mirror of
https://gitcode.com/gh_mirrors/hy/Hydro.git
synced 2026-10-20 01:38:19 +08:00
core: update problem/before-add hook
This commit is contained in:
1 parent
de96722d57
commit
7dc88889c3
3 files changed
+3
-3
No files matched your search
@@ -1,6 +1,6 @@
|
||||
{
|
||||
"name": "hydrooj",
|
||||
"version": "2.28.25",
|
||||
"version": "2.28.26",
|
||||
"bin": "bin/hydrooj.js",
|
||||
"main": "dist/loader.js",
|
||||
"typings": "dist/loader.d.ts",
|
||||
|
||||
@@ -95,7 +95,7 @@ export class ProblemModel {
|
||||
title, tag, hidden, nSubmit: 0, nAccept: 0,
|
||||
};
|
||||
if (pid) args.pid = pid;
|
||||
await bus.serial('problem/before-add', args);
|
||||
await bus.serial('problem/before-add', domainId, content, owner, docId, args);
|
||||
const result = await document.add(domainId, content, owner, document.TYPE_PROBLEM, docId, null, null, args);
|
||||
args.content = content;
|
||||
args.owner = owner;
|
||||
|
||||
@@ -75,7 +75,7 @@ export interface EventMap extends Record<string, any> {
|
||||
'discussion/before-add': (payload: Partial<DiscussionDoc>) => VoidReturn
|
||||
'discussion/add': (payload: Partial<DiscussionDoc>) => VoidReturn
|
||||
|
||||
'problem/before-add': (doc: Partial<ProblemDoc>) => VoidReturn
|
||||
'problem/before-add': (domainId: string, content: string, owner: number, docId: number, doc: Partial<ProblemDoc>) => VoidReturn
|
||||
'problem/add': (doc: Partial<ProblemDoc>, docId: number) => VoidReturn
|
||||
'problem/before-edit': (doc: Partial<ProblemDoc>) => VoidReturn
|
||||
'problem/edit': (doc: ProblemDoc) => VoidReturn
|
||||
|
||||
Reference in new issue
Block a user