refactor deleter code to use unixtimestamp

This commit is contained in:
barisusakli
2017-03-10 22:22:08 +03:00
parent 447b7b02ca
commit 3b41c40b93
3 changed files with 12 additions and 20 deletions

View File

@@ -146,24 +146,6 @@ 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) {