The user state in UserProfile component already has a boolean field for isFriend. That field is NOT included when requesting own profile, only when requesting other profiles.
If user is a friend, show a button to unfriend. Maybe a modal to confirm the action (or just a JS confirm popup if no time for a fancy modal).
Would also be good to tell the user that they have to send a new friend request if they want to become friends again.
As a user I should be able to unfriend a user.
The user state in UserProfile component already has a boolean field for
isFriend
. That field is NOT included when requesting own profile, only when requesting other profiles.If user is a friend, show a button to unfriend. Maybe a modal to confirm the action (or just a JS confirm popup if no time for a fancy modal). Would also be good to tell the user that they have to send a new friend request if they want to become friends again.