-
Notifications
You must be signed in to change notification settings - Fork 2.1k
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
Update teams_discussions with ByID and BySlug endpoints #1426
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thank you, @kadern0!
This is almost ready for a second review and merging, but please make the requested changes first.
Also, for future contributions, please indicate on the original issue that you are going to work on it so that others don't also start working on it and duplicating your work. Thank you!
github/teams_discussions.go
Outdated
// Authenticated user must grant read:discussion scope. | ||
// | ||
// GitHub API docs: https://developer.github.com/v3/teams/discussions/#list-discussions | ||
func (s *TeamsService) ListDiscussions(ctx context.Context, teamID int64, options *DiscussionListOptions) ([]*TeamDiscussion, *Response, error) { | ||
u := fmt.Sprintf("teams/%v/discussions", teamID) | ||
func (s *TeamsService) ListDiscussionsByID(ctx context.Context, orgID, teamID int64, options *DiscussionListOptions) ([]*TeamDiscussion, *Response, error) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Let's please change options
to opts
to match what was recently done in #1417.
Here and throughout this PR.
@@ -44,12 +44,12 @@ type DiscussionListOptions struct { | |||
Direction string `url:"direction,omitempty"` |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
From the documentation, it looks like DiscussionListOptions
also needs to embed a ListOptions
struct to support pagination. Please add this.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
That's correct, I've updated it.
Replaced options by opts within function parameters Added ListOptions to DiscussionListOptions Signed-off-by: Pablo Caderno <[email protected]>
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thank you, @kadern0!
LGTM.
Awaiting second LGTM before merging.
@wesleimp - this could also be reviewed if you have time. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM 👌
Thank you, @wesleimp! |
Fixes #1424