Barış Soner Uşaklı
2018-10-10 17:24:57 -04:00
parent b212a518ba
commit cf1173b0c4

View File

@@ -47,11 +47,12 @@ categoriesController.list = function (req, res, next) {
}
data.categories.forEach(function (category) {
if (category && Array.isArray(category.posts) && category.posts.length) {
if (category && Array.isArray(category.posts) && category.posts.length && category.posts[0]) {
category.teaser = {
url: nconf.get('relative_path') + '/post/' + category.posts[0].pid,
timestampISO: category.posts[0].timestampISO,
pid: category.posts[0].pid,
topic: category.posts[0].topic,
};
}
});