-
Notifications
You must be signed in to change notification settings - Fork 0
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 CRUD SQL queries for Users Table #25
Changes from 2 commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,4 @@ | ||
{ | ||
"editor.formatOnSave": true, | ||
"editor.defaultFormatter": "esbenp.prettier-vscode" | ||
} |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,29 @@ | ||
-- PUT/:uid - Updates an existing user as approved | ||
UPDATE | ||
users | ||
SET | ||
approved = TRUE | ||
WHERE | ||
id = ?; | ||
|
||
-- DELETE/:uid - Deletes an existing user given their id | ||
DELETE FROM | ||
users | ||
WHERE | ||
id = ?; | ||
|
||
-- GET - Returns all data from the Users table | ||
SELECT * FROM | ||
Users; | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. good work! just a minor fix: the There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. oh okay got it I was confused about that, thanks for clarifying. |
||
|
||
-- GET/pending-accounts - Returns all data from Users table who are currently pending approval | ||
SELECT * FROM | ||
Users | ||
WHERE | ||
approved = false; | ||
|
||
-- POST - Adds a new row into Users table | ||
INSERT INTO | ||
Users (id, email, "type", approved) | ||
VALUES | ||
(?,?,?,?); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
also please remove this file