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

Function getOpenPRs

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

Source from the content-addressed store, hash-verified

68 * @todo create cache for RDS usernames <> github usernames
69 */
70const getOpenPRs = async (req, res) => {
71 try {
72 const order = ORDER_TYPE.DESC;
73 const { size, page } = req.query;
74 const { data } = await githubService.fetchOpenPRs({ perPage: size, page, resultOptions: { order } });
75
76 if (data.total_count) {
77 const allPRs = githubService.extractPRdetails(data);
78 return res.json({
79 message: "Open PRs",
80 pullRequests: allPRs,
81 });
82 }
83 return res.json({
84 message: "No pull requests found!",
85 pullRequests: [],
86 });
87 } catch (err) {
88 logger.error(`Error while processing pull requests: ${err}`);
89 return res.boom.badImplementation(SOMETHING_WENT_WRONG);
90 }
91};
92
93module.exports = {
94 getUserPRs,

Callers

nothing calls this directly

Calls

no outgoing calls

Tested by

no test coverage detected