feat(forums): add new fields lastNewTopic & lastNewTopic in mode

This commit is contained in:
OldHawk
2017-07-05 13:01:57 +08:00
parent 82a5dbb65f
commit ed6b7622d1
2 changed files with 9 additions and 3 deletions

View File

@@ -39,7 +39,8 @@ exports.create = function (req, res) {
exports.list = function (req, res) {
Forum.find()
.sort('order -createdat')
.populate('lastTopic')
.populate('lastNewTopic')
.populate('lastReplyTopic')
.populate('moderators', 'username displayName profileImageURL uploaded downloaded')
.exec(function (err, forums) {
if (err) {
@@ -163,7 +164,8 @@ exports.forumByID = function (req, res, next, id) {
}
Forum.findById(id)
.populate('lastTopic')
.populate('lastNewTopic')
.populate('lastReplyTopic')
.populate('moderators', 'username displayName profileImageURL uploaded downloaded')
.exec(function (err, forum) {
if (err) {