mirror of
https://github.com/NodeBB/NodeBB.git
synced 2025-10-26 16:46:12 +01:00
fix(writeapi): normalizing data
This commit is contained in:
@@ -63,6 +63,10 @@ module.exports = function (Posts) {
|
||||
});
|
||||
}
|
||||
await Posts.uploads.sync(data.pid);
|
||||
|
||||
// Normalize data prior to constructing returnPostData (match types with getPostSummaryByPids)
|
||||
postData.deleted = !!postData.deleted;
|
||||
|
||||
const returnPostData = { ...postData, ...editPostData };
|
||||
returnPostData.cid = topic.cid;
|
||||
returnPostData.topic = topic;
|
||||
|
||||
@@ -118,8 +118,9 @@ module.exports = function (Topics) {
|
||||
await Topics.follow(postData.tid, uid);
|
||||
}
|
||||
const topicData = topics[0];
|
||||
topicData.unreplied = 1;
|
||||
topicData.unreplied = true;
|
||||
topicData.mainPost = postData;
|
||||
topicData.index = 0;
|
||||
postData.index = 0;
|
||||
|
||||
analytics.increment(['topics', 'topics:byCid:' + topicData.cid]);
|
||||
|
||||
Reference in New Issue
Block a user