mirror of
https://gitcode.com/gh_mirrors/hy/Hydro.git
synced 2026-10-19 17:38:19 +08:00
core: discussion reaction
This commit is contained in:
1 parent
4b3e2a8e50
commit
bc74870a39
6 files changed
+60
-25
No files matched your search
@@ -206,6 +206,16 @@ class DiscussionDetailHandler extends DiscussionHandler {
|
||||
this.checkPriv(PRIV.PRIV_USER_PROFILE);
|
||||
}
|
||||
|
||||
@param('type', Types.Range(['did', 'drid']))
|
||||
@param('did', Types.ObjectID)
|
||||
@param('id', Types.Name)
|
||||
@param('reverse', Types.Boolean)
|
||||
async postReaction(domainId: string, type: string, did: ObjectID, id: string, reverse = false) {
|
||||
this.checkPerm(PERM.PERM_ADD_REACTION);
|
||||
await discussion.react(domainId, type === 'did' ? document.TYPE_DISCUSSION : document.TYPE_DISCUSSION_REPLY, did, id, this.user._id, reverse);
|
||||
this.back();
|
||||
}
|
||||
|
||||
@param('did', Types.ObjectID)
|
||||
@param('content', Types.Content)
|
||||
async postReply(domainId: string, did: ObjectID, content: string) {
|
||||
|
||||
Reference in new issue
Block a user