Skip to content

Commit

Permalink
allow "show" to be called without a username if
Browse files Browse the repository at this point in the history
authenticated
  • Loading branch information
fjakobs committed Nov 30, 2010
1 parent 5aaf673 commit c4e54d9
Showing 1 changed file with 15 additions and 5 deletions.
20 changes: 15 additions & 5 deletions lib/github/UserApi.js
Expand Up @@ -41,11 +41,21 @@ sys.inherits(UserApi, AbstractApi);
*/
this.show = function(username, callback)
{
this.$api.get(
'user/show/' + encodeURI(username),
null, null,
this.$createListener(callback, "user")
);
if (!callback) {
callback = username;
this.$api.get(
'user/show/',
null, null,
this.$createListener(callback, "user")
);
}
else {
this.$api.get(
'user/show/' + encodeURI(username),
null, null,
this.$createListener(callback, "user")
);
}
};

/**
Expand Down

0 comments on commit c4e54d9

Please sign in to comment.