diff --git a/packages/hydrooj/src/handler/discussion.ts b/packages/hydrooj/src/handler/discussion.ts index a3b19c8a2..c182bc2e6 100644 --- a/packages/hydrooj/src/handler/discussion.ts +++ b/packages/hydrooj/src/handler/discussion.ts @@ -245,8 +245,8 @@ class DiscussionDetailHandler extends DiscussionHandler { for (const uid of uids) { message.send(1, uid, msg, message.FLAG_RICHTEXT | message.FLAG_UNREAD); } - await discussion.addReply(domainId, did, this.user._id, content, this.request.ip); - this.back(); + const drid = await discussion.addReply(domainId, did, this.user._id, content, this.request.ip); + this.back({ drid }); } @param('drid', Types.ObjectID) diff --git a/packages/hydrooj/src/handler/problem.ts b/packages/hydrooj/src/handler/problem.ts index 99a528e04..6c4210d47 100644 --- a/packages/hydrooj/src/handler/problem.ts +++ b/packages/hydrooj/src/handler/problem.ts @@ -776,8 +776,8 @@ export class ProblemSolutionHandler extends ProblemDetailHandler { @param('content', Types.Content) async postSubmit(domainId: string, content: string) { this.checkPerm(PERM.PERM_CREATE_PROBLEM_SOLUTION); - await solution.add(domainId, this.pdoc.docId, this.user._id, content); - this.back(); + const psid = await solution.add(domainId, this.pdoc.docId, this.user._id, content); + this.back({ psid }); } @param('content', Types.Content)