Skip to content

Commit

Permalink
Merge pull request #213 from jeffwilcox/collaborators-paging-support
Browse files Browse the repository at this point in the history
Updating repo collaborators to support paging objects.
  • Loading branch information
pksunkara committed Nov 9, 2015
2 parents 646fc20 + 183d6fe commit 0e0807b
Show file tree
Hide file tree
Showing 2 changed files with 24 additions and 10 deletions.
20 changes: 15 additions & 5 deletions lib/octonode/repo.js

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

14 changes: 9 additions & 5 deletions src/octonode/repo.coffee
Expand Up @@ -27,12 +27,16 @@ class Repo

# Get the collaborators for a repository
# '/repos/pksunkara/hub/collaborators
collaborators: (cbOrUser, cb) ->
if cb? and typeof cbOrUser isnt 'function'
@hasCollaborator cbOrUser, cb
collaborators: (cbParamOrUser, cb) ->
if cb? and typeof cbParamOrUser isnt 'function' and typeof cbParamOrUser isnt 'object'
@hasCollaborator cbParamOrUser, cb
else
cb = cbOrUser
@client.get "repos/#{@name}/collaborators", (err, s, b, h) ->
if cb
param = cbParamOrUser
else
cb = cbParamOrUser
param = {}
@client.getOptions "/repos/#{@name}/collaborators", { headers: { Accept: 'application/vnd.github.ironman-preview+json'} }, param, (err, s, b, h) ->
return cb(err) if err
if s isnt 200 then cb(new Error("Repo collaborators error")) else cb null, b, h

Expand Down

0 comments on commit 0e0807b

Please sign in to comment.