This commit is contained in:
psychobunny
2017-03-10 13:36:24 -05:00
parent dc4d394cd5
commit b3f8428691
3 changed files with 30 additions and 1 deletions

View File

@@ -146,6 +146,24 @@ topicsController.get = function (req, res, callback) {
next(null, data.topicData);
});
},
function (topicData, next) {
if (!topicData.deleterUid) {
return next(null, topicData);
}
user.getUserFields(topicData.deleterUid, ['username', 'userslug'], function(err, deleter) {
if (err) {
return next(err);
}
topicData.deleter = deleter;
topicData.deleter.timestampISO = topicData.deletedTimestampISO
delete topicData.deleterUid;
delete topicData.deletedTimestampISO;
next(null, topicData);
});
},
function (topicData, next) {
function findPost(index) {
for (var i = 0; i < topicData.posts.length; i += 1) {