mirror of
https://github.com/NodeBB/NodeBB.git
synced 2025-10-26 08:36:12 +01:00
fix: groups not showing up on new reply
This commit is contained in:
@@ -228,8 +228,11 @@ module.exports = function (Topics) {
|
|||||||
return postData;
|
return postData;
|
||||||
};
|
};
|
||||||
|
|
||||||
async function onNewPost({ pid, tid }, { uid }) {
|
async function onNewPost({ pid, tid, uid: postOwner }, { uid }) {
|
||||||
const postData = (await posts.getPostSummaryByPids([pid], uid, {})).pop();
|
const [[postData], [userInfo]] = await Promise.all([
|
||||||
|
posts.getPostSummaryByPids([pid], uid, {}),
|
||||||
|
posts.getUserInfoForPosts([postOwner], uid),
|
||||||
|
]);
|
||||||
await Promise.all([
|
await Promise.all([
|
||||||
Topics.addParentPosts([postData]),
|
Topics.addParentPosts([postData]),
|
||||||
Topics.syncBacklinks(postData),
|
Topics.syncBacklinks(postData),
|
||||||
@@ -237,6 +240,7 @@ module.exports = function (Topics) {
|
|||||||
]);
|
]);
|
||||||
|
|
||||||
// Returned data is a superset of post summary data
|
// Returned data is a superset of post summary data
|
||||||
|
postData.user = userInfo;
|
||||||
postData.index = postData.topic.postcount - 1;
|
postData.index = postData.topic.postcount - 1;
|
||||||
postData.bookmarked = false;
|
postData.bookmarked = false;
|
||||||
postData.display_edit_tools = true;
|
postData.display_edit_tools = true;
|
||||||
|
|||||||
Reference in New Issue
Block a user