WEBVTT

00:00.280 --> 00:01.560
Hi everyone.

00:01.560 --> 00:05.520
In this video I will show you how we can update a message.

00:05.680 --> 00:10.200
Okay, so in order to update a message we will create a video.

00:11.280 --> 00:20.160
I will allow the user can edit the the text of the message and the media file of the message.

00:20.200 --> 00:20.680
Right.

00:21.280 --> 00:31.720
So for that reason in this guy I will put the text we will string and media files will be media files.

00:36.280 --> 00:37.560
Over here okay.

00:38.840 --> 00:47.240
And the border is optional and is optional also okay.

00:48.360 --> 00:56.600
And let's say inside the Soviet um we need to put the ID of the message.

00:56.600 --> 00:57.000
Okay.

00:57.040 --> 01:01.160
This is the ID of the message because this is the message of it okay.

01:01.880 --> 01:06.870
We need to update the video And we need a current user.

01:07.910 --> 01:09.350
I user my log.

01:09.790 --> 01:17.470
Okay, firstly we need to find my array.

01:17.950 --> 01:18.350
Okay.

01:18.390 --> 01:19.990
So for a reason it is okay.

01:20.030 --> 01:23.190
I will write it in here.

01:57.910 --> 02:03.710
And after that inside update I will delegate the job into here.

02:11.130 --> 02:12.290
Really I do.

02:13.050 --> 02:15.890
And in here we need to change the screen.

02:16.650 --> 02:18.450
And here we may screen also.

02:18.930 --> 02:19.450
Okay.

02:22.410 --> 02:26.090
After we already found the message, we need to check a little bit.

02:26.650 --> 02:27.570
We need to check.

02:29.650 --> 02:30.170
Right here.

02:30.170 --> 02:32.250
We already checked the message already.

02:34.850 --> 02:35.530
File.

02:36.130 --> 02:36.690
Okay.

02:36.850 --> 02:38.410
It means after that.

02:38.610 --> 02:43.650
After this line of code, the message right here we will also have a data.

02:44.330 --> 02:44.850
Okay.

02:46.570 --> 02:48.970
And we need to check one more thing.

02:48.970 --> 03:03.570
We need to check if the message dot center dot on the screen different with the current user underscore

03:03.570 --> 03:05.810
ID we will throw the error also.

03:08.810 --> 03:11.760
I will throw the new probability graph.

03:12.080 --> 03:17.320
Okay, because I cannot update the message of the unknown user.

03:17.360 --> 03:24.600
Okay, I only can update the message with my my user.

03:28.800 --> 03:33.080
So after that we need to update the message right here.

03:33.440 --> 03:41.960
Dot test equal the restructuring over here.

03:57.680 --> 04:05.480
First, if not we will use the old data in the database and.

04:07.560 --> 04:09.640
Modify basically the set.

04:18.470 --> 04:18.990
Okay.

04:21.070 --> 04:24.870
And make sure we await message dot sign.

04:26.110 --> 04:29.430
And, uh, you may ask me how we can update the message.

04:29.470 --> 04:30.030
Okay.

04:30.470 --> 04:35.830
In later, in order to get the message, we will get all the media file.

04:36.310 --> 04:36.870
Okay.

04:36.910 --> 04:39.430
And we will replace it entirely.

04:39.670 --> 04:47.790
For example, in lecture we have array with the public and a possible I one.

04:58.430 --> 04:59.910
So this is our last okay.

05:00.910 --> 05:06.590
In order to remove the message you just need to override entirely.

05:06.710 --> 05:15.070
First of all I want to remove the bullet to which I need to override and send with a new array like

05:15.070 --> 05:15.390
this.

05:15.390 --> 05:15.420
Nadas.

05:16.220 --> 05:16.700
Okay.

05:17.180 --> 05:20.740
And it will remove the veto.

05:21.580 --> 05:22.100
Okay.

05:22.580 --> 05:24.060
If we want to replace.

05:28.140 --> 05:33.540
Which I said entirely with the new one.

05:36.580 --> 05:36.940
Okay.

05:36.940 --> 05:38.620
I hope you understand this logic.

05:39.580 --> 05:42.860
Okay, let's create the controller.

05:42.860 --> 05:43.940
And that is.

05:54.300 --> 05:54.980
Part.

05:58.660 --> 06:00.020
Of the array part.

06:03.380 --> 06:06.220
And in here I will fix this later.

06:07.620 --> 06:08.660
Let me place.

06:11.580 --> 06:12.340
That over here.

06:13.620 --> 06:14.420
With of that.

06:16.460 --> 06:17.820
With the current user.

06:29.360 --> 06:29.840
Okay.

06:34.400 --> 06:37.400
Let's open.

06:39.600 --> 06:43.960
And base the message ID.

06:48.040 --> 06:48.800
Is R here?

06:50.520 --> 06:52.640
Let's go with the ID of the message.

06:54.760 --> 06:55.560
Go here.

07:03.560 --> 07:04.600
Let me duplicate.

07:09.080 --> 07:09.560
Message.

07:12.160 --> 07:16.000
Change the method to batch and message right here.

07:16.040 --> 07:19.760
Let me remove it and put it over here okay.

07:19.760 --> 07:20.880
This is the URL.

07:22.710 --> 07:23.590
And, uh.

07:26.590 --> 07:27.230
Go here.

07:31.870 --> 07:32.590
All right.

07:32.750 --> 07:33.150
Okay.

07:33.190 --> 07:35.030
We have a, uh.

07:35.670 --> 07:36.230
Hello?

07:37.390 --> 07:38.150
Hi, there.

07:38.190 --> 07:38.710
Okay.

07:39.150 --> 07:40.190
I will call.

07:40.430 --> 07:41.710
Now, you can say hello here.

07:42.070 --> 07:43.110
This is empty.

07:43.150 --> 07:43.630
All right.

07:43.670 --> 07:44.110
Right.

07:44.150 --> 07:45.110
I will call.

07:45.990 --> 07:46.750
Hi, there.

07:48.030 --> 07:48.590
Okay.

07:49.150 --> 07:51.430
And I will vote with this thing.

07:52.310 --> 07:56.070
Let me say we already have a method.

07:56.070 --> 07:56.710
Success.

07:57.030 --> 07:58.070
Let me refresh.

08:05.950 --> 08:10.590
And you can say right now we already got the new media files.

08:11.270 --> 08:14.590
It means the logic of the update already work.

08:14.950 --> 08:18.590
So I hope you understand this logic right here.

08:19.710 --> 08:20.990
And it doesn't hurt.

08:21.030 --> 08:21.790
All right.

08:22.470 --> 08:25.510
So I will see you in the next video.
