Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[ENGINEERING] Create User model and make new user route #7

Open
yxli001 opened this issue Feb 21, 2025 · 0 comments
Open

[ENGINEERING] Create User model and make new user route #7

yxli001 opened this issue Feb 21, 2025 · 0 comments
Assignees

Comments

@yxli001
Copy link
Collaborator

yxli001 commented Feb 21, 2025

What is the issue?

  • Create user model according to the docs
  • Create a POST /api/users route - should also be protected by the auth middleware that Aaryan is going to make - that creates a new user document
    • UID is going to be in req.userId (put there by the auth middleware)
    • all the other fields should be passed in through req.body by whoever is sending the request
    • make sure to create a validator to make sure all the required fields exist and are passed in correctly (express-validator)
    • create a new User document with the sent in fields and return it with res.json()

Additional context

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants