adityabisoi / github-rest-api-v3

GitHub REST API playground
GNU General Public License v3.0
11 stars 20 forks source link

Add support for multiple API endpoints #15

Closed paramsiddharth closed 3 years ago

paramsiddharth commented 3 years ago

Closes #7: Add support for more API endpoints This version supports the following endpoints:

~Additionally, the forked repositories are filtered into a separate array.~

Sample response object:

{
    "username": "paramsiddharth", // The entered username
    "repos": [repo1, repo2, ...], // An array of repo objects
    "gists": [gist1, gist2, ...],
    "followers": [follower1, follower2, ...],
    "following": [user1, user2, ...],
    "starred": [repo1, repo2, ...]
    // "forks": [fork1, fork2, ...] REMOVED
}

In case of a failed request, the corresponding attribute is set to null.

    ...
    "repos": null, // Failed request
    ...

I chained a .catch(...) at the end of the request chain to properly log other network-related errors to the prompt.

adityabisoi commented 3 years ago

@paramsiddharth Please use GitHub contribution guidelines when making a PR https://docs.github.com/en/enterprise/2.16/user/github/managing-your-work-on-github/closing-issues-using-keywords#about-issue-references Use close or closes to automatically close the issue related to the PR.

paramsiddharth commented 3 years ago

@adityabisoi Thank you! I updated the PR with the Closes keyword.

adityabisoi commented 3 years ago

@paramsiddharth I think, we can remove the unnecessary forks for now. The data returned is large and redundant.

paramsiddharth commented 3 years ago

@paramsiddharth I think, we can remove the unnecessary forks for now. The data returned is large and redundant.

Done! Now the response object contains only the username and the data obtained from the 5 endpoints.