diff options
author | Mark Powers <mark@marks.kitchen> | 2021-01-05 20:25:10 -0600 |
---|---|---|
committer | Mark Powers <mark@marks.kitchen> | 2021-01-05 20:25:10 -0600 |
commit | 5b5dc610bc0da17fd006982de50b4dc74b134a54 (patch) | |
tree | ff474a8cdbac4f3867a7b7983e20146929fa8eb5 /src/server.js | |
parent | f2d7673d9743676fcd01d7ab26e7e60d9e21bc8f (diff) |
Refactor likes to use JS to avoid redirect
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 07da08c..773feb0 100644 --- a/src/server.js +++ b/src/server.js @@ -153,7 +153,7 @@ function setUpRoutes(models, jwtFunctions, database, templates) { where: { type, id }, }); post.update({likes: post.likes+1}) - res.redirect(`/post/${type}/${id}`); + res.status(200).send({likes: post.likes}); }) server.get('/tags/:name', async (req, res) => { const { name } = req.params; |