Get User Pull Requests
About
- The getRepositoryClosedPullRequestfunction, an Express.js route handler, retrievesclosed pull requestdetails for a user's GitHub repository. It checks user existence,fetches closed pull requestsusing GitHub service, and handles scenarios likeno user, GitHub service failure, or absence of closed pull requests. The functionorganizes and prepares structured data for each closed pull request, updating or creating pull request documents in the database. User and repository details are also updated accordingly.Error handlingensures appropriate responses for various scenarios, ensuring a reliable interaction with GitHub and the database.
Flow
Endpoint
Routes/Repository/repos.router.js
ReposRouter.get(
  "/user/repos/repo/getPullRequest",
  getRepositoryClosedPullRequest
);