feat(forums): top status of topic set and showed

This commit is contained in:
OldHawk
2017-07-15 13:38:26 +08:00
parent cad028954d
commit 9e6dc7adbc
10 changed files with 68 additions and 5 deletions

View File

@@ -292,6 +292,27 @@ exports.toggleTopicReadonly = function (req, res) {
});
};
/**
* toggleTopicTopStatus
* @param req
* @param res
*/
exports.toggleTopicTopStatus = function (req, res) {
var topic = req.topic;
topic.isTop = !topic.isTop;
topic.save(function (err) {
if (err) {
return res.status(422).send({
message: errorHandler.getErrorMessage(err)
});
} else {
res.json(topic);
}
});
};
/**
* thumbsUp
* @param req