cleanup and tests

This commit is contained in:
Baris Usakli
2017-05-25 16:40:03 -04:00
parent 82cab53508
commit 062bced3dd
12 changed files with 587 additions and 559 deletions

View File

@@ -313,16 +313,13 @@ topicsController.teaser = function (req, res, next) {
}
posts.getPostSummaryByPids([pid], req.uid, { stripTags: false }, next);
},
], function (err, posts) {
if (err) {
return next(err);
}
if (!Array.isArray(posts) || !posts.length) {
return res.status(404).json('not-found');
}
res.json(posts[0]);
});
function (posts) {
if (!Array.isArray(posts) || !posts.length) {
return res.status(404).json('not-found');
}
res.json(posts[0]);
},
], next);
};
topicsController.pagination = function (req, res, callback) {