Fix return value of /building/<id>/like.json
- update to fix log noise meant this was always returning true
This commit is contained in:
parent
29f3bff0d5
commit
d523e2b8a2
@ -262,12 +262,8 @@ server.route('/building/:building_id/like.json')
|
||||
}
|
||||
const { building_id } = req.params;
|
||||
getBuildingLikeById(building_id, req.session.user_id).then(like => {
|
||||
if (typeof (like) === "undefined") {
|
||||
res.send({ like: false })
|
||||
return
|
||||
}
|
||||
// any value returned means like
|
||||
res.send({ like: true })
|
||||
res.send({ like: like })
|
||||
}).catch(
|
||||
() => res.send({ error: 'Database error' })
|
||||
)
|
||||
|
Loading…
Reference in New Issue
Block a user