Skip to content

Commit

Permalink
Add project reaction methods
Browse files Browse the repository at this point in the history
  • Loading branch information
r7kamura committed Nov 14, 2016
1 parent 2d2082e commit 4fe9a20
Showing 1 changed file with 23 additions and 2 deletions.
25 changes: 23 additions & 2 deletions lib/qiita/resource_based_methods.rb
Original file line number Diff line number Diff line change
Expand Up @@ -245,6 +245,13 @@ def create_item_reaction(item_id, params = nil, headers = nil)
post("/api/v2/items/#{item_id}/reactions", params, headers)
end

# ### Qiita::Client#create_project_reaction(project_id, params = nil, headers = nil)
# Add an emoji reaction to an project.
#
def create_project_reaction(project_id, params = nil, headers = nil)
post("/api/v2/projects/#{project_id}/reactions", params, headers)
end

# ### Qiita::Client#delete_comment_reaction(comment_id, reaction_name, params = nil, headers = nil)
# Delete an emoji reaction from a comment.
#
Expand All @@ -259,20 +266,34 @@ def delete_item_reaction(item_id, reaction_name, params = nil, headers = nil)
delete("/api/v2/items/#{item_id}/reactions/#{reaction_name}", params, headers)
end

# ### Qiita::Client#delete_project_reaction(project_id, reaction_name, params = nil, headers = nil)
# Delete an emoji reaction from an project.
#
def delete_project_reaction(project_id, reaction_name, params = nil, headers = nil)
delete("/api/v2/projects/#{project_id}/reactions/#{reaction_name}", params, headers)
end

# ### Qiita::Client#list_comment_reactions(comment_id, params = nil, headers = nil)
# List emoji reactions of an comment.
# List emoji reactions of an comment in recently-created order.
#
def list_comment_reactions(comment_id, params = nil, headers = nil)
get("/api/v2/comments/#{comment_id}/reactions", params, headers)
end

# ### Qiita::Client#list_item_reactions(item_id, params = nil, headers = nil)
# List emoji reactions of an item.
# List emoji reactions of an item in recently-created order.
#
def list_item_reactions(item_id, params = nil, headers = nil)
get("/api/v2/items/#{item_id}/reactions", params, headers)
end

# ### Qiita::Client#list_project_reactions(project_id, params = nil, headers = nil)
# List emoji reactions of an project in recently-created order.
#
def list_project_reactions(project_id, params = nil, headers = nil)
get("/api/v2/projects/#{project_id}/reactions", params, headers)
end

# ### Qiita::Client#list_tags(params = nil, headers = nil)
# List tags in newest order.
#
Expand Down

0 comments on commit 4fe9a20

Please sign in to comment.