Skip to content

Node.js based forum software built for the modern web

fix: remove unused param in addParentPosts

Julian Lam01f7af9291f7
diff --git a/src/topics/create.js b/src/topics/create.js
index 814ff64cb4..fc12465b54 100644
--- a/src/topics/create.js
+++ b/src/topics/create.js
@@ -232,7 +232,7 @@ module.exports = function (Topics) {
] = await Promise.all([
posts.getUserInfoForPosts([postData.uid], uid),
Topics.getTopicFields(tid, ['tid', 'uid', 'title', 'slug', 'cid', 'postcount', 'mainPid', 'scheduled', 'tags']),
- Topics.addParentPosts([postData], uid),
+ Topics.addParentPosts([postData]),
Topics.syncBacklinks(postData),
posts.parsePost(postData),
]);
diff --git a/src/topics/posts.js b/src/topics/posts.js
index 2ed3d208e7..b2eb70d382 100644
--- a/src/topics/posts.js
+++ b/src/topics/posts.js
@@ -129,7 +129,7 @@ module.exports = function (Topics) {
getPostUserData('uid', async uids => await posts.getUserInfoForPosts(uids, uid)),
getPostUserData('editor', async uids => await user.getUsersFields(uids, ['uid', 'username', 'userslug'])),
getPostReplies(postData, uid),
- Topics.addParentPosts(postData, uid),
+ Topics.addParentPosts(postData),
]);
postData.forEach((postObj, i) => {
@@ -178,7 +178,7 @@ module.exports = function (Topics) {
});
};
- Topics.addParentPosts = async function (postData, uid) {
+ Topics.addParentPosts = async function (postData) {
let parentPids = postData
.filter(p => p && p.hasOwnProperty('toPid') && (activitypub.helpers.isUri(p.toPid) || utils.isNumber(p.toPid)))
.map(postObj => postObj.toPid);