Namanl2001 / MERN-Gurujii-dev

⭐️ Helps! in finding Tutors.
https://guru-jii.herokuapp.com/
MIT License
34 stars 85 forks source link

Backend: Admin endpoints #196

Closed Subham142 closed 3 years ago

Subham142 commented 3 years ago

Describe the feature you'd like to add add admin feature by adding middleware and updating the user schema

github-actions[bot] commented 3 years ago

Hi 😄, thanks for creating your first issue at GURUJII, do read and follow the Contribution Guidelines while contributing. Someone from our team will get back here soon.

Subham142 commented 3 years ago

@Namanl2001 please assign it to me

Namanl2001 commented 3 years ago

Sorry, but I didn't get it. Could you explain it a bit more in detail? Thanks

Subham142 commented 3 years ago

its basically means I wanna add an admin feature to this project the admin can
-> fetch all the users, edit their profile, delete users ->fetch all the teachers, edit their profile, delete users

In this issue, I want to add an admin middleware so that if the user is logged in and is an admin he/she could access the admin routes (which will be added after the middleware is done) -> to know if the user is admin or not we need to add an extra argument to the userSchema of isAdmin

Namanl2001 commented 3 years ago

Sounds Good. Please go ahead! 👍