Support for user orgs #72

Merged
merged 2 commits into from Dec 2, 2013

Projects

None yet

2 participants

@malditogeek
Contributor

No description provided.

@pksunkara pksunkara commented on an outdated diff Dec 2, 2013
src/octonode/client.coffee
@@ -68,9 +68,12 @@ class Client
if pageOrQuery? and typeof pageOrQuery == 'object'
query = pageOrQuery
else
- query =
- page: pageOrQuery if pageOrQuery?
- per_page: per_page if per_page?
+ query = {}
+ query.page = pageOrQuery if pageOrQuery?
+ query.per_page = per_page if per_page?
+ #query =
+ # page: pageOrQuery if pageOrQuery?
+ # per_page: per_page if per_page?
@pksunkara
pksunkara Dec 2, 2013 Owner

Hey, can you explain why the above change is made?

Thanks

@pksunkara
pksunkara Dec 2, 2013 Owner

The above 3 lines need to be removed.

@pksunkara
Owner

lgtm.

But please check the diff comments and update the pull request.

Thanks

@malditogeek
Contributor

The current implementation sends "page" and "per_page" queries on each request even if they're not specified. It ends up generation URLs like the following: https://api.github.com/users/malditogeek/orgs?page=&per_page= which breaks some endpoints from GH API. The new implementation generates: https://api.github.com/users/malditogeek/orgs

@pksunkara
Owner

Yes, you are right. I missed that. Can you remove the commented lines? I will merge it as soon as you do that.

Thanks

@malditogeek
Contributor

Sweet. Done! removed the comments. Thanks for the quick reply!

@pksunkara pksunkara merged commit 4ddcb57 into pksunkara:master Dec 2, 2013
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment