Skip to content

Commit

Permalink
[FIX] Message reaction in GraphQL API (#11967)
Browse files Browse the repository at this point in the history
  • Loading branch information
MarcosSpessatto authored and sampaiodiego committed Sep 13, 2018
1 parent 485111d commit 0e7215b
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 3 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -6,9 +6,9 @@ import schema from '../../schemas/messages/addReactionToMessage.graphqls';

const resolver = {
Mutation: {
addReactionToMessage: authenticated((root, { id, icon }, { user }) => new Promise((resolve) => {
addReactionToMessage: authenticated((root, { id, icon, shouldReact }, { user }) => new Promise((resolve) => {
Meteor.runAsUser(user._id, () => {
Meteor.call('setReaction', id.messageId, icon, () => {
Meteor.call('setReaction', icon, id.messageId, shouldReact, () => {
resolve(RocketChat.models.Messages.findOne(id.messageId));
});
});
Expand Down
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
type Mutation {
addReactionToMessage(id: MessageIdentifier!, icon: String!): Message
addReactionToMessage(id: MessageIdentifier!, icon: String!, shouldReact: Boolean): Message
}

0 comments on commit 0e7215b

Please sign in to comment.