WEBVTT

00:00.480 --> 00:01.840
Hi everyone.

00:01.840 --> 00:06.920
In this video let's do the real time for accept friend requests.

00:08.000 --> 00:18.960
Okay, after we already handle the logic over here and boost that into the array of friends over here,

00:20.480 --> 00:23.680
what we need to do right now.

00:27.760 --> 00:34.320
Well, let's think about how the friend will consume this data.

00:35.160 --> 00:35.680
Okay?

00:37.440 --> 00:46.040
When I accept a request for the board right here, let's say in my database, or I already have a friend

00:46.080 --> 00:59.160
request with the bending over here, right when I accept the request chain from the standard bending

00:59.160 --> 01:03.830
Banded Forum accept what we need to happen firstly.

01:07.350 --> 01:13.230
Now if I say it again, you will say we already have this data, right?

01:13.550 --> 01:16.110
This is the bending request, right?

01:17.790 --> 01:25.950
It means right now when I accept the request, I want the front end or I want from the front end perspective,

01:25.950 --> 01:26.590
it will.

01:28.830 --> 01:36.110
It will filter out the object over here okay.

01:36.150 --> 01:41.510
And it will filter out the object based on the ID for that reason.

01:42.230 --> 01:46.750
In the end we should send the ID for the front end.

01:46.910 --> 01:47.390
Okay.

01:47.430 --> 01:49.390
That's the first thing I want to do.

01:50.270 --> 01:58.710
And the second thing really is when I accept the request I want insider.

01:58.710 --> 01:59.590
Get my friend.

01:59.630 --> 02:05.470
It will show the the data.

02:05.750 --> 02:06.190
Okay.

02:06.190 --> 02:09.950
It will boost the data from here.

02:10.710 --> 02:11.030
Okay.

02:11.030 --> 02:13.990
It will boost the data from here into the this array.

02:15.990 --> 02:16.510
Right.

02:17.390 --> 02:19.790
But we have an error.

02:19.830 --> 02:28.430
All the reason because in previous video I already changed the friend DTO, right?

02:28.910 --> 02:29.270
Hmm.

02:30.110 --> 02:35.390
So for that reason, in the friend controller, we need two different method okay.

02:35.430 --> 02:40.430
We need two different method to do that right here.

02:42.910 --> 02:43.830
Let me.

02:46.270 --> 02:47.150
Copy this thing.

02:47.190 --> 02:48.150
Let me cut this thing.

02:48.150 --> 02:52.310
And I will put inside the same friend request okay.

02:54.870 --> 02:55.790
And, uh.

03:01.580 --> 03:04.860
Get current request menu, right?

03:06.500 --> 03:11.500
Actually send friend request and get request.

03:12.860 --> 03:14.900
All right, let me, uh.

03:17.340 --> 03:18.420
Change a little bit.

03:19.860 --> 03:20.740
Respond.

03:21.340 --> 03:22.820
Request, friend.

03:22.860 --> 03:23.340
Okay.

03:24.060 --> 03:24.700
Like that.

03:25.940 --> 03:29.140
And the Visual Studio Code, it will.

03:29.460 --> 03:32.620
Um, we need to rename this.

03:33.020 --> 03:38.260
So this one write Request Studio.

03:39.540 --> 03:46.380
And inside here, let me know that this one write request.

03:46.820 --> 03:48.140
All right.

03:48.860 --> 03:51.420
And right here let's fit this.

03:57.180 --> 03:59.540
First of all, polite request.

03:59.580 --> 04:06.260
Little did we fix that issue and insert the get.

04:06.300 --> 04:08.620
Why remove does.

04:09.340 --> 04:10.740
Also insert a get why?

04:13.500 --> 04:14.020
Okay.

04:17.100 --> 04:20.420
After that we need to create another little.

04:23.220 --> 04:25.500
For respond.

04:26.300 --> 04:26.860
Right.

04:27.460 --> 04:28.540
Little okay.

04:29.220 --> 04:33.980
We need to create the Respond Prime video.

04:37.180 --> 04:38.380
Let's say what we need.

04:44.340 --> 04:45.420
Let me say that again.

04:47.420 --> 04:49.340
Please tell the controller we are.

04:53.060 --> 04:57.530
We don't use any fertilizer over here.

04:57.530 --> 05:01.130
So that reason we will get entire document.

05:01.890 --> 05:02.370
Okay.

05:03.570 --> 05:08.930
What we need to do, we, uh, need the ID and the name.

05:09.130 --> 05:09.650
Right?

05:10.530 --> 05:16.570
And, uh, I think we only need the ID and the name and the avatar.

05:17.450 --> 05:20.010
Maybe we will have avatar.

05:23.690 --> 05:27.650
Okay, so let's go here.

05:29.810 --> 05:33.650
Follow will be the ID and the name.

05:36.530 --> 05:37.850
Right here will be object.

05:43.090 --> 05:46.250
Right here we we done this and it transform over here.

05:47.290 --> 05:49.010
And one more thing will be avatar.

05:50.410 --> 05:52.730
Let me just copy the avatar Earl.

05:52.730 --> 05:53.330
Over here.

05:57.570 --> 06:00.290
And in this case, we only need to object.

06:00.330 --> 06:00.690
Dot.

06:00.890 --> 06:01.650
Amplify.

06:08.530 --> 06:09.050
Okay.

06:09.930 --> 06:11.490
And insert a foreign controller.

06:11.490 --> 06:14.250
Let me view that chart from digital.

06:15.650 --> 06:20.130
And we need to put this one right.

06:20.730 --> 06:21.210
Sorry.

06:21.650 --> 06:22.570
This one.

06:26.210 --> 06:27.610
Right over here.

06:32.370 --> 06:32.970
Let me see.

06:36.010 --> 06:36.410
Okay.

06:36.410 --> 06:39.090
We already got the name.

06:39.890 --> 06:42.210
And right here we will advertise.

06:42.210 --> 06:42.970
Earl.

06:53.640 --> 06:54.080
Okay.

06:54.680 --> 07:02.480
What we need to do, we need to boost the frame into that array right now.

07:03.320 --> 07:05.720
Let's go back to the service and I will show you.

07:06.640 --> 07:07.320
Firstly.

07:09.360 --> 07:19.040
When we accept the friend request, the first one we need to filter out from the friend bindings.

07:24.800 --> 07:32.080
Or in the in the front end we will have a step for frame bindings okay.

07:32.360 --> 07:38.720
And the second one we need to boost the object with the same structure over here.

07:39.680 --> 07:42.360
So the my friend right.

07:42.560 --> 07:43.040
Okay.

07:46.880 --> 07:55.310
So for example we need to emit an media event which now met with a friend request, and they will be

07:55.310 --> 07:55.710
here.

07:57.350 --> 08:04.510
And we need to create exactly the same structure for that, right?

08:05.390 --> 08:08.070
But what is this thing?

08:08.910 --> 08:13.470
Now, you can say when we accept the friend request.

08:15.750 --> 08:21.430
It means we need to look at.

08:24.350 --> 08:24.750
Uh.

08:27.110 --> 08:27.910
The sender.

08:28.270 --> 08:29.630
The sender ID, right.

08:31.710 --> 08:38.750
Now, even with my eyes, it's still confusing.

08:39.110 --> 08:40.550
Let me write a little bit.

08:40.590 --> 08:41.830
But first of all.

08:42.510 --> 08:43.990
Right, now the sender will.

08:43.990 --> 08:44.550
Result.

08:45.430 --> 08:50.670
Result will send a friend Write requests to the receiver.

08:51.230 --> 08:52.350
Ray Thomas.

08:52.910 --> 08:53.390
Okay.

08:53.910 --> 08:54.910
What about right now?

08:55.310 --> 09:00.870
I will log into the account to accept.

09:07.310 --> 09:08.230
The same request.

09:08.270 --> 09:09.430
One same request.

09:09.430 --> 09:09.950
And this is.

09:09.950 --> 09:10.790
Will they accept?

09:11.750 --> 09:15.110
We need to accept Amazon.

09:16.590 --> 09:17.110
Okay.

09:18.830 --> 09:23.030
So it means the zone is a foreign apple Thomas.

09:23.350 --> 09:23.870
Okay.

09:24.070 --> 09:28.070
For that reason, we need to send the sender information.

09:28.270 --> 09:28.710
Right.

09:29.070 --> 09:31.990
So for that reason in this case I will call this dot.

09:34.510 --> 09:35.110
Z y.

09:36.750 --> 09:39.350
Now handle.

09:44.270 --> 09:45.110
Handle.

09:45.790 --> 09:46.510
Accept.

09:48.420 --> 09:49.180
request.

09:49.940 --> 09:57.500
Alright ladies, and firstly we need to send a friend request to filter out.

09:58.260 --> 09:58.700
Right?

10:04.860 --> 10:06.260
Friend request over here.

10:07.300 --> 10:09.260
Let's see what this come from.

10:10.180 --> 10:11.300
This come from here.

10:11.340 --> 10:11.820
Okay.

10:13.140 --> 10:19.340
And the second one we will use the object contain this information.

10:19.980 --> 10:20.580
Okay.

10:20.620 --> 10:30.860
Since this is the object I prefer wrap entirely into the object following with request for sure.

10:31.620 --> 10:33.420
And this object over here.

10:34.900 --> 10:35.420
Right.

10:35.980 --> 10:40.620
So we need to use for label below it.

10:42.140 --> 10:42.700
Okay.

10:45.940 --> 10:52.580
It will come from the senders, from friend, request sender, and a little string over here.

10:52.860 --> 10:53.300
Right.

10:56.100 --> 11:05.260
And the name will be friend request dot sender, dot name.

11:05.460 --> 11:05.980
Right.

11:08.220 --> 11:10.020
And the avatar you.

11:13.420 --> 11:15.300
Would avatar you rl.

11:15.500 --> 11:16.500
We should.

11:18.580 --> 11:23.020
We should create a respondto for us.

11:28.340 --> 11:31.940
You will say right here we have a friend request.

11:38.700 --> 11:39.820
Let me convert this.

12:07.850 --> 12:12.410
Uh, actually, this is should be the first one.

12:12.890 --> 12:14.930
Rank request video.

12:19.890 --> 12:20.610
Podcast.

12:20.650 --> 12:22.370
We need to change the avatar.

12:23.970 --> 12:24.490
Okay.

12:24.930 --> 12:25.650
Over here.

12:27.290 --> 12:28.650
We will respond.

12:29.490 --> 12:33.290
Dot, send the avatar URL.

12:33.610 --> 12:34.130
Okay.

12:35.010 --> 12:39.250
We need to send this thing for the here.

12:40.250 --> 12:41.450
Let's create us.

12:44.850 --> 12:45.170
Here.

12:45.170 --> 12:47.810
We change to handle some room.

13:02.650 --> 13:06.010
And one more thing will be added to.

13:06.410 --> 13:06.850
Okay.

13:06.850 --> 13:09.690
We will need the receiver ID also.

13:09.730 --> 13:10.210
Right.

13:10.610 --> 13:12.730
We need to send receiver ID.

13:12.770 --> 13:16.810
So once the receiver ID.

13:22.610 --> 13:28.130
We still need receiver ID from Tomas.

13:38.730 --> 13:44.840
Now it is scanning it a little bit Different story because right now we already logged in with the Thomas.

13:44.840 --> 13:49.640
It means we need to send back to the sender ID, right for that reason.

13:49.640 --> 13:52.520
In this case it is the first parameter.

13:53.160 --> 13:56.680
I will say the sender id right.

13:56.960 --> 13:58.160
Send id over here.

14:00.960 --> 14:02.560
We will use for right.

14:03.720 --> 14:06.640
Are we already got the underscore ID right here.

14:07.240 --> 14:07.800
Right.

14:08.000 --> 14:14.960
So for that reason in this case we can use data dot to dot underscore ID okay.

14:15.640 --> 14:17.920
And right here we will emit the event.

14:18.320 --> 14:22.760
We will send accept right.

14:23.800 --> 14:26.560
Let us put the data.

14:27.520 --> 14:28.320
Let me check.

14:28.360 --> 14:30.480
Let us say is work or not.

14:45.790 --> 14:46.430
Right now.

14:47.030 --> 14:49.350
Let me test that.

14:50.590 --> 14:51.270
Right here.

14:51.270 --> 14:55.190
I have some bending requests over here.

14:55.230 --> 14:55.670
Right.

14:56.110 --> 14:57.630
We have a bending request.

14:59.350 --> 15:00.550
We need to accept that.

15:00.550 --> 15:01.030
Right.

15:01.070 --> 15:05.470
Let me copy the idea over here and insert a.

15:08.270 --> 15:13.030
Right request and put the ID over here.

15:13.870 --> 15:16.070
And we need to login with Thomas.

15:22.990 --> 15:23.590
Sick.

15:32.950 --> 15:34.150
Now let me say.

15:36.670 --> 15:38.550
We got the So.

15:38.550 --> 15:38.990
Okay.

15:39.630 --> 15:41.110
And let's chat over here.

15:42.070 --> 15:47.830
Now we got this thing, but.

15:50.630 --> 15:54.830
We have a little bit over over here.

15:58.350 --> 15:58.870
Here.

15:59.990 --> 16:00.590
And.

16:05.350 --> 16:07.390
We don't get any name.

16:13.590 --> 16:14.110
Run!

16:14.110 --> 16:15.470
Request over here.

16:16.670 --> 16:21.150
Let me say this is a friend request.

16:21.190 --> 16:21.590
All.

16:25.030 --> 16:25.310
Right.

16:25.310 --> 16:30.710
Here we should popularize the name.

16:31.230 --> 16:31.710
Sorry.

16:32.070 --> 16:33.110
The sender's.

16:38.340 --> 16:39.820
Let's do that again.

16:40.900 --> 16:41.380
Right here.

16:41.380 --> 16:44.780
You can put one more name.

16:45.660 --> 16:46.140
Okay.

16:52.340 --> 16:53.860
Let's turn that again.

16:56.460 --> 16:57.180
Right now.

16:59.580 --> 17:00.860
I will sign in.

17:02.020 --> 17:03.420
Maybe I will clear.

17:08.260 --> 17:09.820
I will clear this one.

17:15.180 --> 17:17.060
And let me send a request again.

17:17.980 --> 17:20.340
Right now I will log in with the zone account.

17:20.500 --> 17:20.980
Okay.

17:21.580 --> 17:25.140
So we zone account.

17:26.820 --> 17:30.620
From zone account, I will send a friend request.

17:33.100 --> 17:34.660
Send friend request.

17:39.060 --> 17:47.300
Okay, after we already send friend requests successfully, we need to sign in with that account.

17:48.700 --> 17:50.780
Okay, this is the entire flows.

17:51.020 --> 17:52.300
I hope you clear.

17:56.100 --> 17:58.540
And go to accept friend request.

17:58.580 --> 18:04.060
Make sure you login with built here and copy the id.

18:04.420 --> 18:05.540
Let me refresh.

18:12.660 --> 18:15.180
I will copy the ID binding over here.

18:18.300 --> 18:22.060
And let me before I send us.

18:23.260 --> 18:23.980
Let me send.

18:25.580 --> 18:32.340
We already got the status because we already removed the details for reasons we don't see the body over

18:32.340 --> 18:35.450
here, but this don't really matter.

18:36.610 --> 18:40.690
And right here, you can see we already got this thing right.

18:42.130 --> 18:46.730
This thing will be the frame of the Thomas and it later.

18:46.770 --> 18:50.810
We need to use this information to put that back to the gate.

18:50.850 --> 18:52.610
My friend over here.

18:52.970 --> 18:55.490
And you will achieve the.

18:58.410 --> 19:00.130
We will achieve the.

19:04.090 --> 19:04.530
Time.

19:04.530 --> 19:04.970
Right.

19:09.170 --> 19:13.730
We are saying with Thomas again.

19:20.290 --> 19:20.850
Right here.

19:20.890 --> 19:21.410
You.

19:21.450 --> 19:23.810
We already got the zone account.

19:23.850 --> 19:24.130
Okay.

19:24.170 --> 19:25.490
With the zone account over here.

19:25.970 --> 19:28.810
So it means we already successfully.

19:29.250 --> 19:31.090
So I will see you in the next one.

19:34.050 --> 19:36.330
Make sure we clean up all the way over here.

19:36.530 --> 19:40.850
Okay, I know it's a little bit, uh, misunderstanding.

19:40.850 --> 19:49.090
And it's very hard at the beginning, but the important, the important part right here is you should

19:49.090 --> 19:52.930
understand what is the sender and what is the receiver.

19:53.410 --> 20:02.210
And maybe in the front end, uh, you can create some documentation for the front end to have the front

20:02.210 --> 20:08.690
end developer can understand what exactly about the sender and what exactly about the receivers.

20:08.730 --> 20:09.210
Okay.

20:10.410 --> 20:21.930
Even with my if I leave this project maybe one week and I will go again, I will not understand.

20:21.970 --> 20:22.290
Okay.

20:22.330 --> 20:22.970
For sure.

20:23.970 --> 20:25.850
So please don't stress.

20:25.890 --> 20:31.530
But let's talk a little bit of time to understand so I will see you in.
