feat(forums): moderators/oper/admin can toggle set topic readonly status

This commit is contained in:
OldHawk
2017-07-11 11:48:28 +08:00
parent aead017cf0
commit 0af12f97ed
8 changed files with 71 additions and 5 deletions

View File

@@ -301,6 +301,27 @@
}, 500);
};
/**
* toggleReadonly
* @param t
*/
vm.toggleReadonly = function (t) {
var topic = new TopicsService({
forum: vm.forum._id,
_id: t._id
});
console.log(topic);
topic.$toggleTopicReadonly(function (res) {
vm.topic = res;
NotifycationService.showSuccessNotify('FORUMS.TOPIC_TOGGLE_READONLY_SUCCESSFULLY');
}, function (res) {
NotifycationService.showErrorNotify(res.data.message, 'FORUMS.TOPIC_TOGGLE_READONLY_FAILED');
});
};
/**
* postReply
* @param isValid