Skip to content

Instantly share code, notes, and snippets.

if(req.body.action == 'unlike') {
//using find a
db.Like.findAll({
where: db.Sequelize.and(
{Post_postId: req.body.postId},
{User_userId: req.user.userId}
)
}).then(function(likes) {
if(likes.length > 0) {