Developing an Unfriend Functionality in Social Media Application

The State Changers meeting centered around resolving issues and finding appropriate solutions to them. The primary issue discussed was how to handle friend removal requests within a system.


There was confusion about how to make the current user 'unfriend' another user, specifically at an endpoint that wasn't delivering the expected results. There was discussion about using the 'remove from end of' function initially but a different method was ultimately decided upon. The agreed approach was a creative use of the 'Find all elements' function within array functions to achieve the aim. The function was used to filter the current friend list by 'unfriending'—a method compared to Mean Girls for its tactic of excluding individuals. The list was then checked to verify the unfriending process, debugging the process to see the removal of a friend from the list. The final step involved in the 'unfriending' process was to implement an update to the database to ensure that the changes made from the 'find all elements' function reflected in the actual friend list of the user. This update was made by setting the friends list in the user record to be the filtered friends list. In summary, the overall concept focused on removing a friend from the current user friend list and ensuring that this change would reflect in the database. The discussed tools or keywords used in this meeting were array functions, 'Find all elements' function, user records updates.


(Source: Office Hours 8/1/2023 )

State Change Members Can View The Video Here
chris-montgomery-smgTvepind4-unsplash.jpg

View This Video Now

Join State Change Risk-Free