mirror of
https://github.com/NodeBB/NodeBB.git
synced 2025-10-30 02:25:55 +01:00
refactor: posts api
This commit is contained in:
@@ -165,3 +165,22 @@ async function isMainAndLastPost(pid) {
|
||||
};
|
||||
}
|
||||
|
||||
postsAPI.upvote = async function (caller, data) {
|
||||
return await apiHelpers.postCommand(caller, 'upvote', 'voted', 'notifications:upvoted_your_post_in', data);
|
||||
};
|
||||
|
||||
postsAPI.downvote = async function (caller, data) {
|
||||
return await apiHelpers.postCommand(caller, 'downvote', 'voted', '', data);
|
||||
};
|
||||
|
||||
postsAPI.unvote = async function (caller, data) {
|
||||
return await apiHelpers.postCommand(caller, 'unvote', 'voted', '', data);
|
||||
};
|
||||
|
||||
postsAPI.bookmark = async function (caller, data) {
|
||||
return await apiHelpers.postCommand(caller, 'bookmark', 'bookmarked', '', data);
|
||||
};
|
||||
|
||||
postsAPI.unbookmark = async function (caller, data) {
|
||||
return await apiHelpers.postCommand(caller, 'unbookmark', 'bookmarked', '', data);
|
||||
};
|
||||
|
||||
Reference in New Issue
Block a user