Hi everyone!
After we already have the ask participants function, we need another method to remove participants
from the group conversation, right?
So that's in the SSI for you.
But please pause the video right here and try to create the another method to remove participants.
Okay.
So how about your solution?
Let me show you how it works.
I will create a method called remove participants over here.
And we need to do exactly the same right here.
Right.
We need participants ID we want to remove and we need to check the conversation.
And we need to check the owner also.
Let me copy.
And Buddhas over here.
Okay.
After that, we need to filter out the conversation based on the idea over here.
Let me try to filter method.
I will jump if it's not inside.
The participants.
Okay.
We will filter out us.
After us.
We need to hold the result because this is the another array.
I will call filter.
Filter participant.
Okay.
And after that make sure we update.
And very important make sure we save it up into the right way.
Okay.
That's for the method.
Let me go to the controllers and I will copy everything here.
And right here you can see this is the application window right.
And actually we can use that.
But I think I will rename a little bit.
And with that all right here we can do that because it's exactly the same.
We don't need to create another video.
So let me copy it over here and remove this one because members right here.
And we can rename the video a bit.
And remove this one.
Okay, so let's open the postman.
And let me open the database.
So.
Firstly I will sign in.
With this account.
Hi.
Okay.
I don't know why I cannot open the postman desktop.
So for that reason, I decided to switch in another tool for testing API.
So I will use this application Insomnia.
Okay.
Let's click on that and download it.
And if you can use the Botman feel free to do that.
Okay.
I don't know why.
In my case it happened to be wrong over here.
So let me show you how we can migrate from the bossman to another API for testing.
Right here you can click on click on more and click on this box and choose the collection and click
on this workstation.
Okay.
After that.
After that you will go back to here.
Okay.
Open the application.
You just download it and right here you can click inside the info section over here.
Click on that and please drag the file you you just over here and click on open.
Okay.
After that you will see the collection over here.
Let me A club, it would ask.
And if you say it exactly the same with the boss man.
Okay, let's try to get that.
Click inside the remote member.
Okay.
You can try to duplicate and create a remote with a remote member.
Also make sure you change the URL.
And right here you should sign in.
Okay.
Copy that token.
And click Insert Remote Members and click on authentication tab right here.
And by this over here.
Okay.
So after that go to the bodies and pass the some participants over here okay.
But flexible over here.
And if I now now you can say I just add a little bit of code right here.
So check for the cannot remove the owner.
Okay, now, if the participant right here is the same with the authentication, we just log in.
Either one remove myself or I don't allow remove the owner.
Right.
So for that reason I will go a little bit over here.
So for event removes the owner's account okay.
So uh that is and if you check the database.
Now if we check inside the conversation.
Let me add members, okay.
To the other member and said, without success.
Okay, let me refresh.
I don't know why.
Let me make up a slip and move over here.
Okay.
And then after that, let me refresh the participants.
Should be three right now.
Okay.
And after that, if I draw the remove member and I got exactly the same with other over here, I said,
well, it's I cannot remove the owner.
So for that reason in this case we should reverse the order.
And over here we will last.
And if I send now, you can say we already got the message.
We made success.
And I expect the participant only have one user.
Let me refresh.
Now you'll see we only have one users, so it means the remote member already work.
Okay.
Let me add it again for the test data.
Bubbles okay.
But right now the remote members already work.
And so thus for the video.
And I hope you understand this course right now.
Okay.
So I will see you in the next one.