Skip to content

Commit b40dc9b

Browse files
author
Guido Marucci Blas
committed
Adds support for fetching repository issues
1 parent f283c10 commit b40dc9b

File tree

2 files changed

+23
-0
lines changed

2 files changed

+23
-0
lines changed

README.md

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -219,7 +219,13 @@ gist.update(delta, function(err, gist) {
219219

220220
});
221221
```
222+
## Issues API
222223

224+
To read all the issues of a given repository
225+
226+
```js
227+
github.getIssues(owner, repo, function(err, issues) {})
228+
```
223229

224230
## Tests
225231

github.js

Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -481,9 +481,26 @@
481481
};
482482
};
483483

484+
// Issues API
485+
// ==========
486+
487+
Github.Issue = function(options) {
488+
var path = "/repos/" + options.owner + "/" + options.repo + "/issues";
489+
490+
this.list = function(options, cb) {
491+
_request("GET", path, options, function(err, res) {
492+
cb(err,res)
493+
});
494+
};
495+
};
496+
484497
// Top Level API
485498
// -------
486499

500+
this.getIssues = function(owner, repo) {
501+
return new Github.Issue({owner: owner, repo: repo});
502+
};
503+
487504
this.getRepo = function(user, repo) {
488505
return new Github.Repository({user: user, name: repo});
489506
};

0 commit comments

Comments
 (0)