(req, res)
| 10 | */ |
| 11 | |
| 12 | const getUserPRs = async (req, res) => { |
| 13 | try { |
| 14 | const { data } = await githubService.fetchPRsByUser(req.params.username); |
| 15 | |
| 16 | if (data.total_count) { |
| 17 | const allPRs = githubService.extractPRdetails(data); |
| 18 | return res.json({ |
| 19 | message: "Pull requests returned successfully!", |
| 20 | pullRequests: allPRs, |
| 21 | }); |
| 22 | } |
| 23 | return res.json({ |
| 24 | message: "No pull requests found!", |
| 25 | pullRequests: [], |
| 26 | }); |
| 27 | } catch (err) { |
| 28 | logger.error(`Error while processing pull requests: ${err}`); |
| 29 | return res.boom.badImplementation(SOMETHING_WENT_WRONG); |
| 30 | } |
| 31 | }; |
| 32 | |
| 33 | /** |
| 34 | * Get stale PRs in open state for Real Dev Squad repos |
nothing calls this directly
no outgoing calls
no test coverage detected