fix(writeapi): normalizing data

v1.18.x
Julian Lam 4 years ago
parent b092f65d95
commit 1392d064a1

@ -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]);

Loading…
Cancel
Save