diff options
author | Mark Powers <mark@marks.kitchen> | 2020-12-30 22:51:22 -0600 |
---|---|---|
committer | Mark Powers <mark@marks.kitchen> | 2020-12-30 22:51:22 -0600 |
commit | f2d7673d9743676fcd01d7ab26e7e60d9e21bc8f (patch) | |
tree | 3a69195b497fbf8f08dc60fabdbcd058e3883e6d /src/server.js | |
parent | 5137bb9b277fcd45327680166c9e39f26ec48c45 (diff) |
Fix likes starting at 0
Diffstat (limited to 'src/server.js')
-rw-r--r-- | src/server.js | 2 |
1 files changed, 1 insertions, 1 deletions
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); |