WEBVTT

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

00:02.560 --> 00:08.960
Actually, I already told you we don't need to upload media or remove file.

00:09.480 --> 00:13.800
But I think the best way is show you how to do that.

00:13.840 --> 00:17.880
Okay, so let me open the upload file.

00:20.080 --> 00:24.920
After we save into the database, we need to emit the event.

00:24.960 --> 00:25.280
Right.

00:25.280 --> 00:27.360
Let me show you how we can do that.

00:29.520 --> 00:31.040
We need to call this dot.

00:36.600 --> 00:37.320
Most did.

00:37.320 --> 00:37.680
Why?

00:40.040 --> 00:43.800
Not handle apply media.

00:43.840 --> 00:44.240
Okay.

00:44.280 --> 00:45.240
Something like this.

00:45.880 --> 00:50.720
And right now what we need to put right here we are.

00:50.720 --> 00:55.160
We need to put entirely apply media literal.

00:55.400 --> 00:57.440
And the ID okay.

00:57.760 --> 01:06.770
So it will be the id and the second parameter is the ratio we want to upload us, right?

01:07.850 --> 01:13.610
Well, in the front end we need to base on the ID of the post right here.

01:13.930 --> 01:20.210
And we need to append this detail into the.

01:22.930 --> 01:25.330
Post with this ID right.

01:26.450 --> 01:31.090
Okay, I hope you already know how we can handle it right now.

01:31.570 --> 01:32.090
Okay.

01:34.450 --> 01:36.250
So if not, let me explain.

01:36.250 --> 01:37.570
111 more time.

01:37.810 --> 01:45.730
Firstly for sure in the in the front end we will have a state with a message.

01:45.730 --> 01:46.170
Right?

01:47.210 --> 01:49.370
So we have a state with a message.

01:49.410 --> 01:51.490
We will some ID.

01:55.490 --> 01:55.930
Okay.

01:55.930 --> 02:03.870
With a message like sorry with a boss or something like that over here with the ID.

02:04.030 --> 02:04.430
Okay.

02:04.470 --> 02:07.510
By on this article here we need to find the object.

02:07.870 --> 02:12.030
And by object we need to create the media file.

02:16.310 --> 02:19.990
And this includes media file.

02:20.030 --> 02:20.550
Okay.

02:20.870 --> 02:21.710
Something like that.

02:21.710 --> 02:22.110
Right.

02:23.830 --> 02:26.790
So I hope you're very clear about that.

02:27.030 --> 02:31.590
Let me create a handle upload media right here.

02:33.350 --> 02:35.110
Let's open the box gateway.

02:37.390 --> 02:41.510
And the first one will be boss ID right screen.

02:42.190 --> 02:48.190
And the second one is a block many editors, which is.

02:50.790 --> 02:51.630
Exactly.

02:51.630 --> 02:52.910
The structure over here.

02:55.870 --> 02:56.310
Right.

02:56.710 --> 02:58.310
Make sure we pop that.

03:00.270 --> 03:03.200
And right here let a media event Several.

03:03.240 --> 03:04.120
Not a big.

03:07.120 --> 03:07.840
Boss.

03:09.520 --> 03:11.120
But he was okay.

03:13.080 --> 03:13.680
And.

03:16.120 --> 03:23.040
I need to put the object with the boss away and upload the details over here.

03:26.160 --> 03:30.280
Or we can send Maria.

03:32.720 --> 03:33.480
Bice.

03:33.640 --> 03:34.160
Okay.

03:34.480 --> 03:36.320
With the upload modality of.

03:37.840 --> 03:38.360
Okay.

03:40.680 --> 03:45.040
Let me double check my files over here.

03:46.000 --> 03:46.520
Okay.

03:47.360 --> 03:49.560
Now let me console.log.

04:16.740 --> 04:19.620
Let me copy this array okay.

04:20.180 --> 04:25.900
And open the block media and change the array.

04:28.660 --> 04:36.780
And now with the body right here I will set exactly the same structure and make sure we stay in that.

04:40.700 --> 04:41.300
Okay.

04:41.460 --> 04:45.380
And let me say now we already got the message.

04:45.420 --> 04:47.340
Let me check right here.

04:47.340 --> 04:50.340
We already got the boss and block media.

04:50.940 --> 04:51.380
Okay.

04:52.820 --> 04:53.380
Very cool.

04:53.420 --> 04:53.820
Right.

05:01.820 --> 05:03.020
And one more thing.

05:03.020 --> 05:06.510
We Please remove media files.

05:06.550 --> 05:11.310
Let me open this to say how we can do that.

05:11.710 --> 05:24.070
If you check the delete media radio, we only need to know what's in the media and what's in the media.

05:24.230 --> 05:28.550
This is for sure will be the public ID of media file, right?

05:29.110 --> 05:37.270
So for that reason, in this case I remove this dot mod z y dot handle.

05:40.430 --> 05:41.110
Remove.

05:44.350 --> 05:44.990
Media.

05:45.510 --> 05:47.310
The first one will be for sure.

05:47.350 --> 05:49.470
We unwind this the bus array.

05:50.230 --> 05:50.710
Right.

05:51.390 --> 05:55.870
And the second one we will use the in.

05:58.910 --> 06:01.270
The media ID right.

06:01.710 --> 06:10.120
I will send back over here media right And based on this idea in the front end, we need to filter out

06:10.720 --> 06:14.240
the object based on this idea over here.

06:14.280 --> 06:14.840
Right?

06:15.880 --> 06:18.160
So that's all what we need.

06:19.480 --> 06:21.920
And let me create us.

06:25.800 --> 06:26.480
Hello.

06:34.000 --> 06:37.440
Firebase Maria.

06:41.840 --> 06:42.360
Hello.

06:59.040 --> 06:59.680
Okay.

06:59.720 --> 07:02.720
Let us and let God sort of.

07:13.300 --> 07:15.580
Let me copy this idea of the boss.

07:24.700 --> 07:25.980
Over here please.

07:26.140 --> 07:30.420
Boris, let me get on the boss again.

07:31.380 --> 07:32.820
Inside the new boss.

07:32.820 --> 07:33.140
Okay.

07:33.140 --> 07:36.340
And over here I will cope with the opiate addict.

07:37.260 --> 07:37.740
Okay.

07:38.420 --> 07:40.380
And over here.

07:40.500 --> 07:43.500
And let me say, we got the message.

07:43.500 --> 07:44.180
Success.

07:44.220 --> 07:51.140
And we already got the boss and media with exactly the same over here and on the front end.

07:51.180 --> 07:55.980
We need to filter out right now the jackpot for that.

07:56.020 --> 08:01.900
So we are already done with the upload media and remove media.

08:02.260 --> 08:06.780
So I hope you understand this video and I will see you in the next.
