Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add remove_assignees method to the client #984

Merged
merged 2 commits into from
Feb 23, 2018
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
17 changes: 17 additions & 0 deletions lib/octokit/client/issues.rb
Original file line number Diff line number Diff line change
Expand Up @@ -329,6 +329,23 @@ def issue_timeline(repo, number, options = {})
def add_assignees(repo, number, assignees, options = {})
post "#{Repository.path repo}/issues/#{number}/assignees", options.merge({:assignees => assignees})
end

# Remove assignees from an issue
#
# @param repo [Integer, String, Repository, Hash] A GitHub repository
# @param number [Integer] Issue number
# @param assignees [Array] Assignees to be removed
# @return [Sawyer::Resource] Issue
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

We're missing the options hash in the documentation here.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks @kytrinyx for the review.

What are you expecting here? The options argument doesn't seem very useful outside of consistency efforts with the rest of this library, as the GitHub API doesn't allow for additional parameters.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Unless I'm missing something, the options hash is where you would pass things like custom accept headers.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Added.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Appreciate it! 🌷

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Dang. I was a bit quick to merge. Still not seeing the options hash—I'll add it in a separate PR.

# @see https://developer.github.com/v3/issues/assignees/#remove-assignees-from-an-issue
# @example Remove assignees "pengwynn" and "joeyw" from Issue #23 on octokit/octokit.rb
# Octokit.remove_assignees("octokit/octokit.rb", 23, ["pengwynn", "joeyw"])
#
# @example Remove assignees "pengwynn" from Issue #23 on octokit/octokit.rb
# Octokit.remove_assignees("octokit/octokit.rb", 23, ["pengwynn"],
# :accept => "application/vnd.github.v3+json")
def remove_assignees(repo, number, assignees, options = {})
delete "#{Repository.path repo}/issues/#{number}/assignees", options.merge({:assignees => assignees})
end
end
end
end
Loading