Module: Panoptes::Client::Comments

Included in:
Panoptes::Client
Defined in:
lib/panoptes/client/comments.rb

Instance Method Summary collapse

Instance Method Details

#create_comment(discussion_id:, body:) ⇒ Object

Post a comment to a talk discussion

Parameters:

  • discussion_id (Integer)

    filter by focussable id

  • focus_type (String)

    filter by focussable type

Returns:

  • list of discussions



9
10
11
12
13
# File 'lib/panoptes/client/comments.rb', line 9

def create_comment(discussion_id:, body:)
  user_id = current_user["id"]
  response = talk.post("/comments", comments: {discussion_id: discussion_id, body: body, user_id: user_id})
  response.fetch("comments")[0]
end