Vita-App / Vita

Bringing life back to your college life.
https://mentorship.thapar.edu/
MIT License
120 stars 78 forks source link

Add limit query parameter on /get-mentors endpoint #46

Closed Rishabh-malhotraa closed 2 years ago

Rishabh-malhotraa commented 2 years ago

Currently our /get-mentors end-point returns all the matched mentors, I would like to pass in a query parameter to tell the server how many mentors do we want to fetch

image

add a query limit to /get-mentors endpoint to limit the number of mentors sent to the front-end

/get-mentors?expertise=All&topic=-1&limit=10
should only send 10 mentors

Files to edit: https://github.com/Rishabh-malhotraa/Vita/blob/main/api/src/controllers/api-controller.ts#L6 (and files in a client who is making a request to this endpoint )

Lalit3716 commented 2 years ago

Can I work on this? I know how to solve this I will use limit method on Mongoose Model.