Systers, an AnitaB.org community
Create a new API Endpoint to Count Pending Mentorship Requests [Mentorship - Backend]
Outline of the task:
Create a new API Endpoint at GET/mentorship_relations/count_pending which counts the number of pending mentorship relations of the current user. Return a dictionary response with key "count" and value as the number of pending mentorship relations.
Steps:
- Setup the mentorship-backend repository locally
- Create a new model for a response body with name "count_pending_requests_response_body" and add it to the namespace of Mentorship Relations. The models can be found here
- In MentorshipRelationDAO, create a static method to count the pending mentorship relations. The DAO can be found here.
- Finally, create a new route "/mentorship_relations/count_pending" which returns the "count_pending_requests_response_body" as response with status code 200. The file for creating the route is located here
- Commit your changes using our Commit message Style Guide.
- Submit a Pull Request, against
gci-dev
branch against the listed issue. - Send mentorship requests on the Swagger with the current user as mentor/mentee.
- Submit a swagger screenshot of "/mentorship_relations/count_pending" [#Screenshot 1] and a screenshot of list of pending mentorship requests on "/mentorship_relations/pending" [#Screenshot 2]. Make sure that the number of requests match.
Resources:
- If you need help or get lost, post a response to our questions topic in our #gci stream.
Work Submission
Submit a link to Pull Request (PR) created with the changes as listed in the GitHub issue, and the 2 screenshots
Task tags
Students who completed this task
_daksha_, asawesome07, HardikJH, i_maier