These are very simplistic, just to show the concept. You would probably want to have some Cloud Code that will verify things in a before-save function. Also all my examples haven't included any error handling but you should add some.
Approve a request
// assuming you saved the FriendRequest.id as maybe an attribute // data-friend-request-id="xxxx" on the Approve button this code is // linked to var friendRequest = new FriendRequest(); friendRequest.id = $(this).data('friendRequestId'); friendRequest.set('status', RequestStatus.approved); friendRequest.save();
Reject a requestAs per Approve, but use
Un-friendAs per Approve, but use