Hi everyone!
In this video we will create one more method to get current.
Request by okay, we will build a method for get current request by date of the current user.
We call it later in the front end.
We need to know, um, we have uh, some friend request we already added to handle us on the front end.
Right.
So for that reason, we need to build this thing.
And let me create us.
Right now we need to call this dot request model dot file.
Right.
And we need to put object.
And right here we need to put a sender.
The sender will be the current user.
Dot underscore id right.
And so we will manage.
So I think this will be enough.
Let me return directly over here.
These are the foreign controller.
Let me create the method.
So here.
I will name.
It current.
And here.
Actually right here.
We should put the receiver.
Okay.
Not not the sender.
Because the I send the request to be between right here.
We should log in as the base.
Right.
And the base will know the I already send the request okay.
With the some list over here.
So for that reason we put the receiver okay.
This is my mistake.
And sometime I, I have a little bit of confusion okay?
So don't worry about us when we will progress in later.
Don't worry.
Okay.
So in this case we will use the get method with the.
All right.
Request ready?
Okay.
I think I will call like that.
Give me request.
Ready?
Okay.
Uh, request.
Ready.
And now let me say.
Um.
Raia, I will open up the account.
Right.
And let's say right here, we got an empty array because we don't have a nice ride so far in this sky
review.
Manually remove the.
Remote.
And remove the users.
Ryuzo.
Ogawa here is already empty because in previous video, the friend request will be rejected.
Right?
For now, let me.
Send request.
And I will get rid of my account and said okay, we already got that.
What about if I log in with my account?
Let's So we will gonna empty, right?
First of all.
Okay.
That is.
Let me log in again.
Okay, so.
We need to add a little bit over here.
We need to know the sender's okay.
The sender name or something like that.
Or the receiver.
Also we need to customize a little bit over here.
But before that let me create a module like okay I will populate the sender and populate the receiver
okay.
And actually right now we don't need to populate the receiver because the receiver is the current user.
Right.
Sometimes we don't need that.
But right now, I will also let me say, okay, we already got something like that.
And, uh, let me select only the name and avatar.
And maybe email.
Okay.
And here will be the same.
We only need this few.
We don't need to, uh.
Over here.
Let me say again, okay.
We only have email name avatar.
And here will be the same, right?
And for sure, we need to add a little bit of, uh, join form DTO over here.
Okay.
We don't want the nested object.
And, uh, but not for the job of the next video.
So I will see you in the next one.