Added posts and categories

This commit is contained in:
Johnathon Slightham
2021-05-17 23:54:14 -04:00
parent 3e681bcf9b
commit fb799fa001
9 changed files with 354 additions and 2 deletions

View File

@@ -46,6 +46,7 @@ userRoutes.route('/create').post((req, res) => {
res.status(409).send("Account already exists");
return;
}
u.permission = 0;
u.save()
.then(() => {
res.status(201).send("Success creating user");
@@ -66,6 +67,7 @@ userRoutes.route('/create').post((req, res) => {
401 - Incorrect
*/
userRoutes.route('/login').post((req, res) => {
console.log(req.body);
if (!req.body) {
res.status(401).send("Missing body");
return;