feat(forums): user can thumbs up to topic and reply with score donate

This commit is contained in:
OldHawk
2017-07-12 12:12:13 +08:00
parent 512f924964
commit dcfb91a59a
11 changed files with 117 additions and 15 deletions

View File

@@ -311,15 +311,12 @@
_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');
});
};
/**
@@ -374,5 +371,24 @@
vm.postReplyFields.content = list.join('\n');
vm.beginPostReply();
};
/**
* beginThumbsUp
* @param t,topic
* @param r,reply
*/
vm.beginThumbsUp = function (t, r) {
var topic = new TopicsService({
forum: vm.forum._id,
_id: t._id,
_replyId: r ? r._id : undefined
});
topic.$thumbsUp(function (res) {
console.log(res);
vm.topic = res;
NotifycationService.showSuccessNotify('FORUMS.TOPIC_TOGGLE_READONLY_SUCCESSFULLY');
});
};
}
}());