# Friendships MVP ### Users Controller - [X] method for requested friends (to disable button) - [X] method for friend requests - [X] method for all friends (including both approved requests from others and requests to others that have been approved) ### Friendships Controller - [X] method for approving a request - in model - [X] method for denying a request - via destroy route - [X] Data from current_user and page load should determine how a page is displayed (friends/ add friend/ requested versions of button) - [ ] Friend requests should trigger a one-time notification on the target user (in main nav - save for notifications bonus?) - [X] Add data about requests to current_user on the window and include with user data on get requests ### Friendship routes - [X] GET requests for user data include friend request data - key value pairs instead of array O(1) - [X] POST a friendship request, return the updated user with new friendship data `/api/friendships` - [X] PATCH an approval of a request, return the updated user data `/api/friendships/:id` - [X] DELETE a rejection of a request, return the updated user data `/api/friendships/:id` ### Frontend - [X] User can send a friend request from a different user's profile page - [X] User can click a button in their friend requests dropdown to approve or deny - [X] User can approve a friend request from the requesting user's profile page - [X] Friend button will display 'friends' if users are already friends - [X] Refactor to put friends as key value pairs instead of as an array
Friendships MVP
Users Controller
Friendships Controller
Friendship routes
/api/friendships/api/friendships/:id/api/friendships/:idFrontend