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:

  1. Setup the mentorship-backend repository locally
  2. 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
  3. In MentorshipRelationDAO, create a static method to count the pending mentorship relations. The DAO can be found here.
  4. 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
  5. Commit your changes using our Commit message Style Guide.
  6. Submit a Pull Request, against gci-dev branch against the listed issue.
  7. Send mentorship requests on the Swagger with the current user as mentor/mentee.
  8. 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:

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

  • python
  • mentorship-backend
  • flask

Students who completed this task

_daksha_, asawesome07, HardikJH, i_maier

Task type

  • code Code
close

2019