SE310-1 / W.A.K

W.A.K is a movie tracker web-app developed to simplify and enhance the movie-rating experience while making this process more fun and customisable.
MIT License
2 stars 12 forks source link

Create add friends feature #59

Closed klam656 closed 1 year ago

klam656 commented 1 year ago

Create the necessary functions, hooks and REST method and modifying the database model which help implementing the add friends features.

Modify database structure - I simply add to array in the user collection, which are friends, and friendRequests.

Hooks:

  1. useFriendRequests - (GET the all item/username from the friendRequests array)
  2. useFriends - (GET the all item/username from the friends array)
  3. useSearchUsers - (GET the all username that match the search prompt)

Functions:

  1. addFriend - add username in the friendRequests array
  2. acceptFriendRequest - add both users' username in their friends array
  3. declineFriendRequest - remove username in the friendRequests

Contribute to #55