Closed richardantao closed 4 years ago
I decided to do
POST /friends (add)
PATCH /friends (respond)
PUT /friends(manage)
because we'd want the friend ids to not be exposed
How are you accessing the id?
it's all handled in the controller:
since the friendrequests and friends will be associated with the requestor/friend's id I was thinking they would be passed in res.body
exports.friend_respond = (req, res) => {
const { requestor, response } = req.body;
...
}
exports.friend_manage = (req, res) => {
const { friend, decision } = req.body;
...
}
REST for friends would be:
POST /friends (add)
PATCH /friends/:friendId (respond)
PUT /friends/:friendId (manage)