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")
|
// var client = retailcrm.New("https://demo.url", "09jIJ")
|
||||||
//
|
//
|
||||||
// data, status, err := client.UpdateScopes("moysklad3", retailcrm.UpdateScopesRequest{
|
// data, status, err := client.UpdateScopes("moysklad3", retailcrm.ScopesRequired{
|
||||||
// Requires: retailcrm.ScopesRequired{Scopes: []string{"scope1", "scope2"}}},
|
// Scopes: []string{"scope1", "scope2"},
|
||||||
// })
|
// })
|
||||||
//
|
//
|
||||||
// if err.Error() != "" {
|
// if err.Error() != "" {
|
||||||
@ -2179,8 +2179,7 @@ func (c *Client) UpdateScopes(code string, request ScopesRequired) (UpdateScopes
|
|||||||
"requires": {string(updateJSON)},
|
"requires": {string(updateJSON)},
|
||||||
}
|
}
|
||||||
|
|
||||||
data, status, err := c.PostRequest(
|
data, status, err := c.PostRequest(fmt.Sprintf("/integration-modules/%s/update-scopes", code), p)
|
||||||
fmt.Sprintf("/integration-modules/%s/update-scopes", code), p)
|
|
||||||
if err != nil {
|
if err != nil {
|
||||||
return resp, status, err
|
return resp, status, err
|
||||||
}
|
}
|
||||||
|
@ -6573,6 +6573,7 @@ func TestClient_UpdateScopes(t *testing.T) {
|
|||||||
defer gock.Off()
|
defer gock.Off()
|
||||||
|
|
||||||
request := ScopesRequired{Scopes: []string{"scope1", "scope2"}}
|
request := ScopesRequired{Scopes: []string{"scope1", "scope2"}}
|
||||||
|
|
||||||
jr, _ := json.Marshal(&request)
|
jr, _ := json.Marshal(&request)
|
||||||
|
|
||||||
gock.New(crmURL).
|
gock.New(crmURL).
|
||||||
@ -6605,6 +6606,7 @@ func TestClient_UpdateScopes_Fail(t *testing.T) {
|
|||||||
defer gock.Off()
|
defer gock.Off()
|
||||||
|
|
||||||
request := ScopesRequired{Scopes: []string{"scope1", "scope2"}}
|
request := ScopesRequired{Scopes: []string{"scope1", "scope2"}}
|
||||||
|
|
||||||
jr, _ := json.Marshal(&request)
|
jr, _ := json.Marshal(&request)
|
||||||
|
|
||||||
gock.New(crmURL).
|
gock.New(crmURL).
|
||||||
|
Loading…
Reference in New Issue
Block a user