Hard.
Everyone in this video we will know the released media file.
Okay, so let's understand how we can delete the media file.
If you remember in the schema this is the media types okay.
We don't have the some ID unique ID.
So how we can delete that.
And that's my mistake from the Cloudinary controller.
Well Maxwell we will return the public ID from the result okay.
The public address.
This is the unique identifier from the image or the media file okay.
This public array is very important, But somehow I forgot that.
It was here.
So listing the ID is the unique identifier of the entire image.
So after that, let me create a.
Registry.
And inside here.
Go to the upload media.
Let's build the public addy.
Remember.
Uh, sorry.
When we block.
We will need Addy.
Let me show you.
Inside a block.
Multiple file I will send again.
Uh, we don't see.
The reason?
Because Maxwell will put that in here, so.
Okay, let me send it again.
Okay.
We already got the unit identifier.
Okay.
This is the ID, and, uh, after that, let's go to the bus service.
We already got this thing.
Okay.
And now let me use the remote.
So what we need to do, I will put the boss ID and the media ID, okay, this is the idea, right?
But I think I will call the manager ID three screen right now.
And firstly we need to find the boss.
Right.
We need to find the boss as usual.
And after that we need to update the media view.
Hmm.
I think we we will change a little bit.
From here.
I will call the media files, but better, right?
Alright.
Jen over here will be fine.
Okay.
After we got the media file.
We need to.
Your media file dot filter.
We need to filter the media file.
With the.
Array equal with the array.
We will filter our list.
And after that why this.
Model side okay.
And these are the controller.
Let me ask you this.
Mm.
Let's see.
Mm.
I think I will use exactly the same.
Right here.
We need to create a detail to delete.
So here we only need the media to be strict and is not empty.
Okay.
Like that.
And right here.
We are.
And actually right here this is the video right.
So for that reason we need to refactor a little bit.
More over here.
So we had asked okay because we need a validation on the details.
For that reason we need to create a DTO also.
Okay.
So let's test that.
Right here.
After we have our data I will basically take right away.
And I will close.
Go to apply boss.
Are replaced with some idea via remote URL.
Send us after successfully.
Let's check the database.
Okay.
Uh.
Oh, the reason?
Because we just modify the column for a reason.
We need to.
Here.
Video file.
Let me say media.
Insider is born.
With a pass.
I cannot let me release.
And create the new one.
-- me!
Daddy!
What?
Over here.
So.
Refresh.
Over.
We already got the media file.
With a bubbly array.
Right.
Now, let me come over here and let me show you inside here.
Let's show the delete.
Duplicate.
Media.
Passwords is the media ID.
And this is the most I'd.
Say success.
And let's see.
Let me refresh.
Okay, cool.
We already removed.
Right.
The media file.
All right.
Okay.
The logic is already work.
And let me get on bus again.
Okay.
Media file with split file over here.
So that is okay.
That's for the video.
And I will see you in the next one.