This commit is contained in:
undefined committed 2020-06-26 16:34:37 +08:00
1 parent 560e920624
commit d59710ddf1
13 files changed
+181 -49

No files matched your search

+6 -2
View File
@@ -92,7 +92,10 @@ class DiscussionNodeHandler extends DiscussionHandler {
page,
await system.get('DISCUSSION_PER_PAGE'),
);
const udict = await user.getList(domainId, ddocs.map((ddoc) => ddoc.owner));
const [udict, vnodes] = await Promise.all([
user.getList(domainId, ddocs.map((ddoc) => ddoc.owner)),
discussion.getNodes(domainId),
]);
const path = [
['Hydro', 'homepage'],
['discussion_main', 'discussion_main'],
@@ -109,6 +112,7 @@ class DiscussionNodeHandler extends DiscussionHandler {
vndict,
vnode: this.vnode,
page_name: 'discussion_node',
vnodes,
};
}
}
@@ -141,7 +145,7 @@ class DiscussionCreateHandler extends DiscussionHandler {
title, content, this.request.ip, highlight,
);
this.response.body = { did };
this.response.redirect = `/discuss/${did}`;
this.response.redirect = this.url('discussion_detail', { did });
}
}
+1 -1
View File
@@ -151,7 +151,7 @@ class RecordDetailConnectionHandler extends contest.ContestHandlerMixin(Connecti
async onRecordChange(data) {
const rdoc = data.value;
if (rdoc._id.toString() !== this.rid.toString()) return;
if (!rdoc._id.equals(this.rid)) return;
this.send({
status_html: await this.renderHTML('record_detail_status.html', { rdoc }),
summary_html: await this.renderHTML('record_detail_summary.html', { rdoc }),