MCPcopy Create free account
hub / github.com/RealDevSquad/website-backend / getUserPRs

Function getUserPRs

controllers/pullRequests.js:12–31  ·  view source on GitHub ↗
(req, res)

Source from the content-addressed store, hash-verified

10 */
11
12const 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

Callers

nothing calls this directly

Calls

no outgoing calls

Tested by

no test coverage detected