diff --git a/server/queries/users.sql b/server/queries/users.sql new file mode 100644 index 0000000..1700cdc --- /dev/null +++ b/server/queries/users.sql @@ -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; + +-- 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 + (?,?,?,?); \ No newline at end of file