Skip to content

Commit 375863e

Browse files
committed
Add the options to the listTags function
1 parent 52008ca commit 375863e

File tree

2 files changed

+8
-2
lines changed

2 files changed

+8
-2
lines changed

lib/Repository.js

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -78,11 +78,12 @@ class Repository extends Requestable {
7878
/**
7979
* List the tags on a repository
8080
* @see https://developer.github.com/v3/repos/#list-tags
81+
* @param {Object} options - pagination for the list
8182
* @param {Requestable.callback} [cb] - will receive the tag data
8283
* @return {Promise} - the promise for the http request
8384
*/
84-
listTags(cb) {
85-
return this._request('GET', `/repos/${this.__fullname}/tags`, null, cb);
85+
listTags(options, cb = options) {
86+
return this._request('GET', `/repos/${this.__fullname}/tags`, options !== 'function' && options, cb);
8687
}
8788

8889
/**

test/repository.spec.js

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -459,6 +459,11 @@ describe('Repository', function() {
459459
});
460460

461461
it('should list tags on repo', function(done) {
462+
const options = {
463+
per_page: 30
464+
};
465+
466+
remoteRepo.listTags(options, assertSuccessful(done));
462467
remoteRepo.listTags(assertSuccessful(done));
463468
});
464469

0 commit comments

Comments
 (0)