Hi everyone!
This is the additional feature for the free service will be on three.
Okay, when I built this application I completely forgot this feature.
And actually it's very easy to build the wooden frame.
Okay, so right now what we do we will look up the current user and friendly okay.
And right now we need to find the frame and based on the user survey.
And we need to check a little bit over here.
Okay.
And right here you you cannot unfriend yourself okay.
For sure.
And right here we need to check that is correct.
Okay.
Let me show you the check for read it later.
Don't worry about us.
If this is not the is correct we will throw the error.
And after that we.
We need to remove the frame in both sides.
Okay.
Because the A and B.
It also happen.
happy.
All right.
Right.
For a reason.
We need to remove Posey.
And we also want to remove the frame.
Friend.
Request model.
Okay.
Make sure we remove the friend request model.
And we only remove the threat model with the standard will be accepted.
Okay.
Because when we accept friend request, the standard will be changed to accept.
Okay.
When we unfriend we want, it will remove us.
All right.
For that reason, we will put a wait over here.
We will remove it both for reasons I will create or operator.
And that is an array and boots like us.
So and we will block the handle frame on friend.
I will send the friend and the current user.
Okay.
Let's pause the video and paint a little bit.
Why I say that all in the front end you will understand.
And inside here I will call the target user id.
Furthermore, A and B is a thread okay.
The I11 friendly, one unfriendly.
It means the target user in this case will be the dummy, right?
The target.
User and this is the full friendly will be the I right.
So that is the job of the handle right.
And let me show you the some helper function.
Firstly is the check a frame.
Okay I will go to the user service and create one more helper function.
Call the check frame and remove the some id over here and it returns a boolean right.
I will check something like that.
I will find the user by user ID and select the frames.
All right.
And we to check a little bit over here I will map through the frame and convert the ID into a string
and check.
Include here okay, if it include.
We are friends, right?
And one more helper function will be to remove frame it.
Very easy.
We just need to move out from the array right?
Please bool operator.
It will.
It will remove the element inside out.
Right.
Okay.
For example like we have a right one two and three okay.
When we want to pull the element we will use, when you want to remove the element, we will use the
pull operator and specify the the ID we want to remove.
Okay.
So that about pull parameter and make sure we return a new thing okay.
Right about two function over here.
So that's for the video.
And nice.
So I hope you understand.