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

Make Backend Routes for Users #23

Closed
ThatMegamind opened this issue Nov 22, 2023 · 0 comments · Fixed by #26
Closed

Make Backend Routes for Users #23

ThatMegamind opened this issue Nov 22, 2023 · 0 comments · Fixed by #26
Assignees
Labels

Comments

@ThatMegamind
Copy link
Collaborator

ThatMegamind commented Nov 22, 2023

Instructions

  • Create CRUD routes for each query associated with Users, which will allow us to access the data from the frontend

Notes

  • Use the queries under server/queries/users.sql as a jumping-off point!

Acceptance Criteria

Routes should be created for the following:

  • GET - Returns all data from the Users table
  • GET/pending-accounts - Returns all data from Users table who are currently pending approval
  • POST - Adds a new row into Users table
  • PUT/:uid - Updates an existing user as approved
    • Note: all fields in the req.body are optional (i.e. not all attributes in the table need to be specified)
  • DELETE/:uid - Deletes an existing user given their id

Logistics:

  • Add the routes in a file located in routes/users.js
  • app.js should be updated accordingly
  • Delete server/queries/users.sql once this task is complete

As always, feel free to message Michael and Michelle if you have any questions!

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

Successfully merging a pull request may close this issue.

3 participants