Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fetching user repositories, getting "Uncaught TypeError: object is not a function" #26

Closed
g12mcgov opened this issue Mar 8, 2015 · 2 comments

Comments

@g12mcgov
Copy link

g12mcgov commented Mar 8, 2015

Hi there,

I'm trying to use gh3 to fetch repositories for a user. I'm able to create a new user object and obtain specific info regarding that user, however, I can't seem to actually get the repositories for that user. This is currently the code I'm using to do that:

var userRepositories = function(userObject) {
    var repos = new Gh3.Repositories(userObject);

    repos.fetch(function() {
        console.log("Repositories", repos);
    }, function(){},{page:1, per_page:500, direction : "desc"});

};

And this is the error I'm getting in Chrome dev tools:

Uncaught TypeError: object is not a function VM567:977        
Gh3.Repositories.Kind.extend.fetch.Gh3.Helper.callHttpApi.success VM567:255 
Gh3.Helper.Kind.extend.callHttpApi.apiParams.successjquery.min.js:3 
b.Callbacks.cjquery.min.js:3 b.Callbacks.p.fireWithjquery.min.js:5 
kjquery.min.js:5 b.ajaxTransport.send.r

Am I making the call right? Or am I doing something else wrong?

@k33g
Copy link
Owner

k33g commented Mar 10, 2015

Try this:

var userRepositories = function(userObject) {
  var repos = new Gh3.Repositories(userObject);
  repos.fetch({page:1, per_page:500, direction : "desc"}, "next", function(err, res) {
      console.log("Repositories", repos);
  });
};

@k33g
Copy link
Owner

k33g commented Mar 10, 2015

@k33g k33g closed this as completed Mar 10, 2015
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants