core: fix discussion.problem relation

This commit is contained in:
undefined committed 2021-11-17 22:12:47 +08:00
1 parent 86379f4ace
commit 2f66bbfabd
3 files changed
+16 -2

No files matched your search

+1 -1
View File
@@ -250,7 +250,7 @@ export async function getVnode(domainId: string, type: number, id: string, uid?:
if (type === document.TYPE_PROBLEM) {
const pdoc = await problem.get(domainId, Number.isSafeInteger(+id) ? +id : id);
if (!pdoc) throw new DiscussionNodeNotFoundError(id);
return { ...pdoc, type, id };
return { ...pdoc, type, id: pdoc.docId };
}
if ([document.TYPE_CONTEST, document.TYPE_TRAINING, document.TYPE_HOMEWORK].includes(type as any)) {
const model = type === document.TYPE_TRAINING ? training : contest;