Hi everyone.
In this video let's handle the reject friend request.
Okay, but before that, what happened?
If I click on send friend request one more time?
Okay.
Now you can see in the database we already have.
This friend request right here.
And we already accept that okay.
It means if I send one more time I should prevent that okay.
But right here if I send it should work and it will create another thing will be pending.
And that's what I want okay.
That's not what I want.
Okay.
And what if you somehow prevent us because we already have this thing?
Okay, so let me, uh, remove the last one.
Let me show you how we can fix that.
If we open the create method, you can say in here we already prevent duplicate with same frame, right.
But in this case, we only check if this here will be pending status.
Okay.
So right here we should check if status is pending or accept we will prevent us.
So in this guy I will put the the object.
With the in operator and would arrive ready Accept.
Okay, if they all accept, we will throw the error.
Let's say right here.
If I say okay, we already got error.
The friend request already sent.
Okay.
So I think that will be enough.
You can config the.
The message right here a little bit, but I think that will be enough.
Okay.
And now let's build a reject.
Friend request.
Go back to the controller and let me hear.
And ask Gentle Richard.
Current use of run request array right here will be rechecked for a request and it are not exactly the
same.
Will not accept a friend request with a base.
Rename.
Okay, here we find the request okay.
And we check here.
We check it out.
So right here we don't need to use reject and save that.
We don't need to move anything over here, let me know, okay.
Because in order to reject, we just need to put the reject over here.
Okay.
So.
Until now, that is.
Let me open the database and I will remove the friend request right here also.
Let's remove that.
And go to reducer and remove the array for right over here select manually remove.
Just click on edit over here.
So here update.
Okay click edit here.
Click on just icon and update.
Okay.
Now, after that, let me say it again.
Let me send a friend request again.
We already sent with the buddy status.
And let me create the recheck.
And make sure we login with the account receiver.
Okay.
And let's copy the ID.
Okay.
And let me click on friend request.
Uh.
Bot right here.
Ah, sorry for that.
We should create a reject.
Okay.
My bad, my bad.
Let me, uh, delete it again.
Users.
Okay, let's set the request again.
Goodbye, then.
Copy the ID and move it over here.
And let's click on Foreign requests.
Okay.
Let's do that.
We will reject and click on the users.
Okay.
Still empty it manually.
Aurora.
Correct.
Right.
And this will be for the video.
I will see you.