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

fix: correct endpoints for custom roles #2370

Merged
merged 2 commits into from
May 23, 2022
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
2 changes: 1 addition & 1 deletion github/org_custom_roles.go → github/orgs_custom_roles.go
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@ type CustomRepoRoles struct {
//
// GitHub API docs: https://docs.github.com/en/rest/orgs/custom-roles
func (s *OrganizationsService) ListCustomRepoRoles(ctx context.Context, org string) (*OrganizationCustomRepoRoles, *Response, error) {
u := fmt.Sprintf("organizations/%v/custom_roles", org)
u := fmt.Sprintf("orgs/%v/custom_roles", org)

req, err := s.client.NewRequest("GET", u, nil)
if err != nil {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ func TestOrganizationsService_ListCustomRepoRoles(t *testing.T) {
client, mux, _, teardown := setup()
defer teardown()

mux.HandleFunc("/organizations/o/custom_roles", func(w http.ResponseWriter, r *http.Request) {
mux.HandleFunc("/orgs/o/custom_roles", func(w http.ResponseWriter, r *http.Request) {
testMethod(t, r, "GET")
fmt.Fprint(w, `{"total_count": 1, "custom_roles": [{ "id": 1, "name": "Developer"}]}`)
})
Expand Down