WEBVTT

00:01.360 --> 00:05.080
Now let's continue with the update method.

00:05.720 --> 00:17.800
Well, what we need to update in the conversion session, we only allow the owner can update the name

00:18.560 --> 00:19.800
and the avatar.

00:20.160 --> 00:20.680
Okay.

00:21.000 --> 00:26.280
Only two fields right here can be update right?

00:26.800 --> 00:31.440
So for this video right here click on Update Conversion.

00:32.400 --> 00:37.200
We will provide the group name right.

00:38.360 --> 00:39.480
And the avatar.

00:55.200 --> 00:55.880
Over here.

01:00.680 --> 01:03.120
And we can put the is optional.

01:05.480 --> 01:07.100
And right here can we?

01:07.140 --> 01:09.340
Is also.

01:11.420 --> 01:14.260
This for the update conversation video.

01:15.140 --> 01:24.140
And thirdly we need to put the we need to file the conversation right.

01:42.740 --> 01:47.180
After that we need to add objective conversation log file.

01:47.940 --> 01:49.100
I will go new.

01:51.420 --> 01:52.980
Log file etc..

01:58.740 --> 02:01.380
And after that we need to add one more chat.

02:02.140 --> 02:04.260
Only the owner can update.

02:04.540 --> 02:05.060
Okay.

02:05.620 --> 02:11.220
We don't allow the normal members can update.

02:11.740 --> 02:15.830
So in We need to vote the current user.

02:19.830 --> 02:22.310
Right in here.

02:22.350 --> 02:33.230
Let's try to check if the current user dot underscore id different between the current conversation

02:33.230 --> 02:36.030
from here dot zero.

02:38.870 --> 02:40.150
.23.

02:43.190 --> 02:45.750
Okay maybe different.

02:46.950 --> 02:51.630
I will throw no problem.

02:53.670 --> 02:54.230
At this.

02:55.750 --> 02:57.550
And after that we need to update.

03:01.270 --> 03:06.870
We can write code to update directly over here.

03:10.070 --> 03:10.430
And.

03:14.470 --> 03:16.510
Let me say we have a conversation.

03:19.450 --> 03:22.170
We can update directly over here.

03:26.930 --> 03:27.730
Equal.

03:28.810 --> 03:30.290
Let me restructuring.

03:46.610 --> 03:47.610
And roadmap.

03:51.650 --> 03:55.610
But we have a little problem with this approach.

03:59.970 --> 04:05.850
If we use something like that we always need to update to view at the same time.

04:06.250 --> 04:06.730
Okay.

04:07.490 --> 04:15.210
If we only update the avatar, it means the group name right here will be somehow become undefined and

04:15.210 --> 04:17.290
this will remove this line.

04:17.530 --> 04:18.530
I don't want that.

04:18.690 --> 04:24.570
I want if I provide only the avatar, I want the group name.

04:24.980 --> 04:29.460
We will go to the previous name.

04:29.860 --> 04:30.340
Okay.

04:30.380 --> 04:32.340
The old name is the database.

04:32.820 --> 04:35.980
So for a result in this here, we need to add a little bit of check.

04:36.340 --> 04:44.500
If we don't provide any group avatar I will take a look at the conversation dot avatar right here.

04:48.740 --> 04:50.620
And right here.

04:50.620 --> 04:50.940
So.

04:58.340 --> 04:58.820
Okay.

04:59.820 --> 05:01.220
And now the first approach.

05:01.220 --> 05:07.580
And the second approach we can use the find my add and update okay.

05:07.700 --> 05:09.580
You can use thus.

05:20.580 --> 05:23.580
Far body and update okay.

05:23.580 --> 05:26.300
We can put the conversation here.

05:26.700 --> 05:30.060
And both the DTO directly does okay.

05:30.100 --> 05:32.800
But I will not do that right now.

05:33.440 --> 05:35.520
I will try to show you a different approach.

05:36.120 --> 05:44.280
If we use the conversation directly over here with the fiber and the block three five.

05:44.320 --> 05:48.640
By the end of that, we cannot add a little bit object over here.

05:49.400 --> 05:55.040
For that reason we need to find that first and update later.

05:55.680 --> 05:56.160
Okay.

05:58.200 --> 06:06.160
So let's go to the controllers patch method with the current user.

06:30.960 --> 06:31.360
Okay.

06:31.360 --> 06:32.200
Let me show you.

06:40.370 --> 06:43.330
And of that, only the name.

06:53.610 --> 06:54.290
Anyway.

07:01.330 --> 07:04.450
Let me say, okay, we already have that successfully.

07:05.330 --> 07:07.890
And let me get that again.

07:08.650 --> 07:09.050
Okay.

07:09.050 --> 07:16.850
We already know that if we login with the different user for example like from us, let me show you.

07:28.930 --> 07:38.530
Say okay we already got the formula which mean the logic right here already work as we expect it.

07:38.930 --> 07:43.450
So I hope you understand and I will see you.
