Skip to content
Open
Changes from 1 commit
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
Prev Previous commit
Next Next commit
Add removeLabel() to remove a label from an issue
  • Loading branch information
asmsuechan committed Jul 11, 2017
commit 345fd2d0e6a60fc62afbf1b40b5f456bb59bb327
12 changes: 12 additions & 0 deletions lib/Issue.js
Original file line number Diff line number Diff line change
Expand Up @@ -258,6 +258,18 @@ class Issue extends Requestable {
addLabel(issue, label, cb) {
return this._request('POST', `/repos/${this.__repository}/issues/${issue}/labels`, label, cb);
}

/**
* Add label to an issue
* @see https://developer.github.com/v3/issues/labels/#remove-a-label-from-an-issue
* @param {number} issue - the id of the issue to comment on
* @param {string} label - the name of the label to remove to the issue
* @param {Requestable.callback} [cb] - will receive the status
* @return {Promise} - the promise for the http request
*/
removeLabel(issue, label, cb) {
return this._request('DELETE', `/repos/${this.__repository}/issues/${issue}/labels/${label}`, null, cb);
}
}

module.exports = Issue;