-
Notifications
You must be signed in to change notification settings - Fork 264
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
Add pullrequests/:id
route to fetch PRs of a given id
of user using GitHub API
#90
Changes from 1 commit
0595fe0
960f9d6
2a1d53e
5d616fd
cddeed0
4152827
f9ea2a0
c5f36de
cae714a
7f0714b
157ba58
5c8a473
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
- Loading branch information
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -13,7 +13,7 @@ const { fetchUser } = require('../models/users') | |
const getPullRequests = async (req, res) => { | ||
try { | ||
const { user } = await fetchUser(req.params.id) | ||
const url = `${config.baseUrl}/search/issues?q=org:${config.org}+author:${user.github_id}+type:pr` | ||
const url = `${config.githubApi.baseUrl}/search/issues?q=org:${config.githubApi.org}+author:${user.github_id}+type:pr` | ||
const { data } = await githubService.fetch(url) | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Why is the fetch function moved to githubService? Also, the API call should be made from githubService file as per mentioned in the comment: #90 (comment) The controller should handle any response modifications and error handling. |
||
|
||
if (data.total_count) { | ||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
As used elsewhere, use config.get('')