CGUC / skybunk-server

The back-end application for Conrad Grebel University College students to stay connected
3 stars 9 forks source link

Added liking endpoint #75

Closed scholvat closed 5 years ago

scholvat commented 5 years ago

Adding an end point for liking a post. Currently this is done using updatePost endpoint, which is not very secure because then any user can edit any part of the post. There will be a corresponding change to the client sides, but it will be dependent on this PR: https://github.com/CGUC/skybunk-mobile/pull/143. This PR will be merged before PR #72, since that PR needs these updates to function properly.

scholvat commented 5 years ago

@neilbrub Good point about isLike, it is now changed to addLike.

scholvat commented 5 years ago

On a bit of a tangent, is there a reason the client uses post.likes and post.usersLiked? Why doesn't it just use post.usersLiked.length?

neilbrub commented 5 years ago

On a bit of a tangent, is there a reason the client uses post.likes and post.usersLiked? Why doesn't it just use post.usersLiked.length?

Haha no not really, other than the fact that we started with just the concept of how many likes a post had and only later introduced the concept of tracking who'd liked what (and I guess then didn't acknowledge the obviously easier way of doing it :P). Happy to get rid of the count field altogether :+1: (isn't it great to have fresh eyes xD)