这是indexloc提供的服务,不要输入任何密码
Skip to content
This repository was archived by the owner on Aug 23, 2024. It is now read-only.

Add support for adding teams to repos #303

Merged
merged 1 commit into from
Feb 2, 2018
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
20 changes: 20 additions & 0 deletions lib/octonode/team.js

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

12 changes: 12 additions & 0 deletions src/octonode/team.coffee
Original file line number Diff line number Diff line change
Expand Up @@ -99,6 +99,18 @@ class Team extends Base
return cb(err) if err
if s isnt 200 then cb(new Error("Team repos error")) else cb null, b, h

# Add repo to a team
# '/teams/37/repos/flatiron/hub' PUT
addRepo: (repo, cbOrOptions, cb) ->
if !cb? and cbOrOptions
cb = cbOrOptions
param = {}
else if typeof cbOrOptions is 'object'
param = cbOrOptions
@client.put "/teams/#{@id}/repos/#{repo}", param, (err, s, b, h) ->
return cb(err) if err
if s isnt 204 then cb(new Error("Team addRepo error")) else cb null, b, h

# Remove repo from a team
# '/teams/37/repos/flatiron/hub' DELETE
removeRepo: (repo, cb) ->
Expand Down