Skip to content

Commit

Permalink
Merge pull request #173 from sportngin/TOURNEY-6353-my-admin-access
Browse files Browse the repository at this point in the history
TOURNEY-6353 my-admin-access
  • Loading branch information
real-mj-song authored Jul 3, 2018
2 parents d8aab79 + bf2b3cd commit dafed7f
Show file tree
Hide file tree
Showing 3 changed files with 13 additions and 9 deletions.
14 changes: 7 additions & 7 deletions package.json
Original file line number Diff line number Diff line change
@@ -1,19 +1,19 @@
{
"name": "ngin_client",
"version": "0.2.63",
"version": "0.2.64",
"description": "Node client for interacting with the NGIN API services",
"main": "./index.js",
"dependencies": {
"async": "0.2.x",
"glob": "*",
"request": "2.16.6",
"underscore": "*",
"glob": "4.4.x",
"request": "^2.72.0",
"underscore": "1.8.x",
"extendable": "git://github.com/mikefrey/extendable-1"
},
"devDependencies": {
"mocha": "*",
"sinon": "*",
"blanket": "*"
"mocha": "2.1.x",
"sinon": "1.13.x",
"blanket": "1.1.x"
},
"engines": {
"node": ">=0.8.0 <0.11"
Expand Down
6 changes: 5 additions & 1 deletion src/boss/organization.js
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,11 @@ module.exports = function(ngin) {

mine: function(options, callback) {
if (typeof options == 'function') callback = options, options = {}
var url = Organization.urlRoot() + '/mine'
if (config.my_admin_access_roles) {
options.query = _.extend({}, options.query, { roles: config.my_admin_access_roles })
options.qsStringifyOptions = _.extend({}, options.qsStringifyOptions, { arrayFormat: 'brackets' })
}
var url = Organization.urlRoot() + '/my_admin_access'
return Model.list.call(this, url, options, callback)
}

Expand Down
2 changes: 1 addition & 1 deletion test/boss/organization_test.js
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,7 @@ describe('Organization Model', function() {
assert(!err)
assert(!!org)
assert.equal(resp.req.method, 'GET')
assert.equal(JSON.parse(resp.body).metadata.url, '/organizations/mine')
assert.equal(JSON.parse(resp.body).metadata.url, '/organizations/my_admin_access')
done()
})
})
Expand Down

0 comments on commit dafed7f

Please sign in to comment.