mirror of
https://github.com/retailcrm/api-client-go.git
synced 2024-11-25 06:16:03 +03:00
Fix for the UpdateScopes method
This commit is contained in:
parent
735103b9bd
commit
cd567755e7
@ -2156,8 +2156,8 @@ func (c *Client) IntegrationModuleEdit(integrationModule IntegrationModule) (
|
||||
//
|
||||
// var client = retailcrm.New("https://demo.url", "09jIJ")
|
||||
//
|
||||
// data, status, err := client.UpdateScopes("moysklad3", retailcrm.UpdateScopesRequest{
|
||||
// Requires: retailcrm.ScopesRequired{Scopes: []string{"scope1", "scope2"}}},
|
||||
// data, status, err := client.UpdateScopes("moysklad3", retailcrm.ScopesRequired{
|
||||
// Scopes: []string{"scope1", "scope2"},
|
||||
// })
|
||||
//
|
||||
// if err.Error() != "" {
|
||||
@ -2179,8 +2179,7 @@ func (c *Client) UpdateScopes(code string, request ScopesRequired) (UpdateScopes
|
||||
"requires": {string(updateJSON)},
|
||||
}
|
||||
|
||||
data, status, err := c.PostRequest(
|
||||
fmt.Sprintf("/integration-modules/%s/update-scopes", code), p)
|
||||
data, status, err := c.PostRequest(fmt.Sprintf("/integration-modules/%s/update-scopes", code), p)
|
||||
if err != nil {
|
||||
return resp, status, err
|
||||
}
|
||||
|
@ -6573,6 +6573,7 @@ func TestClient_UpdateScopes(t *testing.T) {
|
||||
defer gock.Off()
|
||||
|
||||
request := ScopesRequired{Scopes: []string{"scope1", "scope2"}}
|
||||
|
||||
jr, _ := json.Marshal(&request)
|
||||
|
||||
gock.New(crmURL).
|
||||
@ -6605,6 +6606,7 @@ func TestClient_UpdateScopes_Fail(t *testing.T) {
|
||||
defer gock.Off()
|
||||
|
||||
request := ScopesRequired{Scopes: []string{"scope1", "scope2"}}
|
||||
|
||||
jr, _ := json.Marshal(&request)
|
||||
|
||||
gock.New(crmURL).
|
||||
|
Loading…
Reference in New Issue
Block a user