mirror of
https://gitcode.com/gh_mirrors/hy/Hydro.git
synced 2026-10-20 01:38:19 +08:00
ui: add missing 'domainId' for error tracing (#1092)
This commit is contained in:
1 parent
296cdbb091
commit
0f75f7ce36
3 files changed
+6
-6
No files matched your search
@@ -357,10 +357,10 @@ class DiscussionRawHandler extends DiscussionHandler {
|
|||||||
} else {
|
} else {
|
||||||
const [doc] = await discussion.getHistory(domainId, drrid || drid || did, ts ? { time: new Date(ts) } : {});
|
const [doc] = await discussion.getHistory(domainId, drrid || drid || did, ts ? { time: new Date(ts) } : {});
|
||||||
if (!doc) {
|
if (!doc) {
|
||||||
if (ts) throw new DiscussionNotFoundError(drrid || drid || did);
|
if (ts) throw new DiscussionNotFoundError(domainId, drrid || drid || did);
|
||||||
if (drrid && !this.drrdoc) throw new DiscussionNotFoundError(drrid);
|
if (drrid && !this.drrdoc) throw new DiscussionNotFoundError(domainId, drrid);
|
||||||
if (drid && !this.drdoc) throw new DiscussionNotFoundError(drid);
|
if (drid && !this.drdoc) throw new DiscussionNotFoundError(domainId, drid);
|
||||||
if (did && !this.ddoc) throw new DiscussionNotFoundError(did);
|
if (did && !this.ddoc) throw new DiscussionNotFoundError(domainId, did);
|
||||||
}
|
}
|
||||||
this.response.type = 'text/markdown';
|
this.response.type = 'text/markdown';
|
||||||
this.response.body = doc ? doc.content : drrid ? this.drrdoc.content : drid ? this.drdoc.content : this.ddoc.content;
|
this.response.body = doc ? doc.content : drrid ? this.drrdoc.content : drid ? this.drdoc.content : this.ddoc.content;
|
||||||
|
|||||||
@@ -915,7 +915,7 @@ export class ProblemSolutionHandler extends ProblemDetailHandler {
|
|||||||
@param('psrid', Types.ObjectId)
|
@param('psrid', Types.ObjectId)
|
||||||
async postDeleteReply(domainId: string, psid: ObjectId, psrid: ObjectId) {
|
async postDeleteReply(domainId: string, psid: ObjectId, psrid: ObjectId) {
|
||||||
const [psdoc, psrdoc] = await solution.getReply(domainId, psid, psrid);
|
const [psdoc, psrdoc] = await solution.getReply(domainId, psid, psrid);
|
||||||
if (!psdoc || psdoc.parentId !== this.pdoc.docId) throw new SolutionNotFoundError(psid);
|
if (!psdoc || psdoc.parentId !== this.pdoc.docId) throw new SolutionNotFoundError(domainId, psid);
|
||||||
if (!this.user.own(psrdoc) || !this.user.hasPerm(PERM.PERM_DELETE_PROBLEM_SOLUTION_REPLY_SELF)) {
|
if (!this.user.own(psrdoc) || !this.user.hasPerm(PERM.PERM_DELETE_PROBLEM_SOLUTION_REPLY_SELF)) {
|
||||||
this.checkPerm(PERM.PERM_DELETE_PROBLEM_SOLUTION_REPLY);
|
this.checkPerm(PERM.PERM_DELETE_PROBLEM_SOLUTION_REPLY);
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -846,7 +846,7 @@ export async function del(domainId: string, tid: ObjectId) {
|
|||||||
|
|
||||||
export async function get(domainId: string, tid: ObjectId): Promise<Tdoc> {
|
export async function get(domainId: string, tid: ObjectId): Promise<Tdoc> {
|
||||||
const tdoc = await document.get(domainId, document.TYPE_CONTEST, tid);
|
const tdoc = await document.get(domainId, document.TYPE_CONTEST, tid);
|
||||||
if (!tdoc) throw new ContestNotFoundError(tid);
|
if (!tdoc) throw new ContestNotFoundError(domainId, tid);
|
||||||
return tdoc;
|
return tdoc;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
Reference in new issue
Block a user