diff --git a/access_scopes.go b/access_scopes.go index 43058d6b..3bad4da2 100644 --- a/access_scopes.go +++ b/access_scopes.go @@ -1,6 +1,8 @@ package goshopify -import "context" +import ( + "context" +) type AccessScopesService interface { List(context.Context, interface{}) ([]AccessScope, error) @@ -23,8 +25,12 @@ type AccessScopesServiceOp struct { // List gets access scopes based on used oauth token func (s *AccessScopesServiceOp) List(ctx context.Context, options interface{}) ([]AccessScope, error) { - path := "oauth/access_scopes.json" + path := "admin/oauth/access_scopes.json" resource := new(AccessScopesResource) - err := s.client.Get(ctx, path, resource, options) + req, err := s.client.NewRequest(ctx, "GET", path, nil, options) + if err != nil { + return nil, err + } + err = s.client.Do(req, resource) return resource.AccessScopes, err } diff --git a/access_scopes_test.go b/access_scopes_test.go index db5b3be8..24d15258 100644 --- a/access_scopes_test.go +++ b/access_scopes_test.go @@ -2,7 +2,6 @@ package goshopify import ( "context" - "fmt" "reflect" "testing" @@ -15,7 +14,7 @@ func TestAccessScopesServiceOp_List(t *testing.T) { httpmock.RegisterResponder( "GET", - fmt.Sprintf("https://fooshop.myshopify.com/%s/oauth/access_scopes.json", client.pathPrefix), + "https://fooshop.myshopify.com/admin/oauth/access_scopes.json", httpmock.NewBytesResponder(200, loadFixture("access_scopes.json")), )