Fixed issues with category routes and worked on post routes

This commit is contained in:
2023-02-02 15:26:47 -05:00
parent 555fc37047
commit 24e2326dc4
11 changed files with 513 additions and 53 deletions

View File

@@ -21,7 +21,7 @@ postRoutes.route('/create').post((req, res) => {
utils.account.checkSession(req.body.userId, req.body.sessionId, (isValidId) => {
utils.account.isAdmin(req.body.userId, (isAdmin) => {
if (isValidId && isAdmin) {
let p = new Post(req.body);
let p = new Post(req.body.post);
p.date = utils.date.dateToEpoch(p.date);
p.save()
.then(() => {