mirror of
https://github.com/taobataoma/meanTorrent.git
synced 2026-02-28 01:00:59 +01:00
feat(forums): moderators/oper/admin can toggle set topic readonly status
This commit is contained in:
@@ -140,6 +140,27 @@ exports.updateTopic = function (req, res) {
|
||||
});
|
||||
};
|
||||
|
||||
/**
|
||||
* toggleTopicReadonly
|
||||
* @param req
|
||||
* @param res
|
||||
*/
|
||||
exports.toggleTopicReadonly = function (req, res) {
|
||||
var topic = req.topic;
|
||||
|
||||
topic.readOnly = !topic.readOnly;
|
||||
|
||||
topic.save(function (err) {
|
||||
if (err) {
|
||||
return res.status(422).send({
|
||||
message: errorHandler.getErrorMessage(err)
|
||||
});
|
||||
} else {
|
||||
res.json(topic);
|
||||
}
|
||||
});
|
||||
};
|
||||
|
||||
/**
|
||||
* deleteTopic
|
||||
* @param req
|
||||
|
||||
Reference in New Issue
Block a user