How everyone in this video.
Let's continue with the remote conversations.
Okay, we need to write a little bit of chat.
Firstly, we need to file the conversation and in order to remove the entire place, we don't need to
check this is a group or not.
We will remove even if this is a group or not.
Okay, so for that reason we only need to check this here.
And if the conversation is a group, we need to check the owner okay.
If not, let's remove everything.
So let me copy this line of code and paste this to here.
Okay.
Firstly we find the conversation.
Let me check a bit.
So here we only check.
If not, we will throw error.
Okay.
And right here we need to move the current user.
If the composition is up and we need to check group owner.
Okay.
And if not, we will throw the error forbidden, etc..
Okay.
And after that we just need to call composition dot removes.
Dot delete one.
Let us make sure we are y okay.
Go to the controllers and let me Pass in.
Sorry.
Pass up Charlie I over here.
And removes I encourage users.
Okay, now let me open the test API and I will copy this URL over here and click on the list and replace
the URL and remove it here okay.
Yeah.
Now let me.
But they let me.
Relax right here with it and moved over here.
And right now I will start in with not a counter up account.
Okay, I will change it.
And I forgot to run the application.
Why?
Okay, let me say and copy the access token.
We also the release right here.
Let me change the name Click on rename.
To remove the bodies.
And right here.
Right set it.
We got the forbidden.
Okay.
Let me try to do that again and say forbidden.
So right now I will sign.
With this account send us and copy over here.
Replace and say we already got the success okay.
And let's check otherwise.
Okay.
We are remove already removed.
And let me rename the age group.
It will be fun right here.
I will delete that.
Say okay.
The message will be success and let's refresh.
So it means right now we already write the logic for removes the conversation successfully.
And you might think after we already removes the conversation, we should remove all messages in the
conversation, right?
But that's actually not true at all because the message is very important.
Okay.
So advertise or something like that.
So for that reason in this case I think the message I will not remove the message okay.
We still hold the data in the database okay.
But if you want to remove all the messages in conversation.
Feel free to do that.
Okay, I will leave that for you.
Okay, let's create the message service to rider.
Close it for remove entire message.
And in Java, message service into the conversation service and write the code over here.
For example line write this dot message service dot delete.
Okay first of all like that.
And we need to move the conversation dot underscore idea over here to remove entire message.
So I will not do that I will leave that job for you okay.
So let me fix the error.
Okay.
So that's for the video I will see you in the next one.