Skip to content

Commit

Permalink
fix: #290 (#291)
Browse files Browse the repository at this point in the history
  • Loading branch information
pnmcosta authored May 24, 2024
1 parent 3cc7152 commit 46c5292
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 5 deletions.
12 changes: 9 additions & 3 deletions access_scopes.go
Original file line number Diff line number Diff line change
@@ -1,6 +1,8 @@
package goshopify

import "context"
import (
"context"
)

type AccessScopesService interface {
List(context.Context, interface{}) ([]AccessScope, error)
Expand All @@ -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
}
3 changes: 1 addition & 2 deletions access_scopes_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,6 @@ package goshopify

import (
"context"
"fmt"
"reflect"
"testing"

Expand All @@ -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")),
)

Expand Down

0 comments on commit 46c5292

Please sign in to comment.