From f2d7673d9743676fcd01d7ab26e7e60d9e21bc8f Mon Sep 17 00:00:00 2001 From: Mark Powers Date: Wed, 30 Dec 2020 22:51:22 -0600 Subject: Fix likes starting at 0 --- src/server.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'src') diff --git a/src/server.js b/src/server.js index cd76b5d..07da08c 100644 --- a/src/server.js +++ b/src/server.js @@ -266,8 +266,8 @@ function setUpRoutes(models, jwtFunctions, database, templates) { try { const type = req.body.type req.body.description = marked(req.body.description) + req.body.likes = 0 const newPost = await models.posts.create(req.body); - newPost.likes = 0 req.files.forEach(async (file) => { await models.pictures.create({ "source": "uploads/" + file.filename, "postId": newPost.id }); console.log("uploaded ", file.path); -- cgit v1.2.3