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

[SDK-3030] Wrong url when doing assign users with a callback #686

Merged
merged 3 commits into from
Jan 26, 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 src/management/RolesManager.js
Original file line number Diff line number Diff line change
Expand Up @@ -355,7 +355,7 @@ class RolesManager {
}

if (cb && cb instanceof Function) {
return this.permissions.create(params, data, cb);
return this.users.create(params, data, cb);
}

return this.users.create(params, data);
Expand Down
10 changes: 10 additions & 0 deletions test/management/roles.tests.js
Original file line number Diff line number Diff line change
Expand Up @@ -671,6 +671,16 @@ describe('RolesManager', () => {
});
});

it('should perform a POST request to /api/v2/roles/rol_ID/users with a callback', function (done) {
const { request } = this;

this.roles.assignUsers(this.data, {}, () => {
expect(request.isDone()).to.be.true;

done();
});
});

it('should pass the data in the body of the request', function (done) {
nock.cleanAll();

Expand Down