Hi everyone.
In this video let's continue with the users.
Okay?
In this video we will do for my own method over here.
Right here we just need to return this dot.
User model dot file.
Okay.
And let's start.
Let me up the row over here.
So that is.
Right here you can see we already got user with some stuff like that.
And uh.
Let's go to the file one method.
With.
Here we define one method.
We don't list any authorization because everyone can see the profile.
Okay.
So let me do that.
Okay.
Let.
Me.
Get a users.
Say okay.
We already got.
And now one more thing we will delete.
Okay.
Well in order to do the list we should we showed you the technique.
Soft release.
Right?
Okay.
Inside the database schema, we need to provide one more block.
Okay.
I will call it ASAP.
Will be the folder.
And the file will be true.
Okay.
When we create a new user file we will go.
And when we release.
When we release, we just need to.
Turn off that.
Let me show you.
The file and An update here would add.
And we need to update.
That is if we make false.
Okay.
That's how we can remove the user and let return the user also.
Oh actually I think we don't need to return anything because this is just the how we can remove.
Okay.
Actually we need to check if user new session.
And we don't need to return anything.
Okay, this will be good, right?
And not so good of you to drop.
Let me show you.
Now, if I refresh the database with the users.
Now, you can see we don't have any.
Is active right here because we only created this data before, right?
Let me say right here I will duplicate a gentle release delete user soft release okay.
And I will.
Say we have an internal server error.
Let me double check.
We have error from here.
Uh.
Let me say.
Right now, the reason we need to check.
Let me say, uh.
Right now, if we return a user, it should work, right?
Let me say.
If I return a user, it worked.
But if I don't return, it means this guy artillery away and will not return anything over here.
Well, we still got the.
So I think we need to.
I will go to the.
Channel for a little bit.
I need to fix that.
Right here.
We need to check if we have a data.
Right.
The reason we we call right here, if we console.log the data, let's say.
Now data will be undefined, right?
And we we are not calling here into the undefined method.
For that reason, it will throw an error.
Okay, let me check.
And this should work.
Let me say right here we already got method success.
And let me refresh.
Now you will see this here will be adaptive will be false right.
And I think we we should put over here with this user.
And I will refresh and I will update manually.
It's back to the draw method.
Okay.
Furthermore here I will want to show.
Okay.
I think we already have enough tape.
We need to fix a little bit over here.
Is that a user service?
You can see right here if I get on users.
Let me, uh, turn off the sun.
Now, you can say, uh, right here.
We still got this thing.
Okay.
This thing is already disabled account or is active phone.
Okay.
I don't want to show that in here.
So for some reason, we need to add a little bit of check condition over here.
Okay.
We already filter this to be true.
If it will be formed we will filter out that.
And this will be for the file one.
Over here.
Uh, with this guy, we don't need any projection.
We can put on the file.
And right here we can boost the is update.
Um, no, let me say.
Okay.
We can move it over here.
Right?
Hmm.
We will drop also.
And let's get current user right here will be also.
Is update.
We will go okay.
We need to a little bit of checking over here.
Remove the method over here and remove unused import.
This side again.
Okay, we already got and we need to fix the return.
Okay.
Right here.
Maybe inside the DTO over here, we need to export one more thing, which is update.
Rate.
And we need to say that.
Okay.
We already got is active.
And, uh, we need to fix the authentication also.
Okay.
Because when we logged in right here.
We need to check if the user are visible.
We need to throw the error.
Okay, let me show you after we already have a use here, we need to check inside this method if user
A will be false result, but request exception that the cloud account.
Has low bit.
Okay something like that.
And we need to fix the by lot also okay.
Because the is active field can be for authentication Asian information.
Right?
So what?
We need to put that inside.
Okay.
And that is a design method also.
User active.
Okay.
And we need to put that inside the authentication right here which is opaque because the user just a
bit we need to fit in user by a little bit.
Here we pull it up.
Okay.
Now let's test again.
How we side by side with account is no longer a person.
Okay.
Your account has no longer active as well.
Log in right here.
Okay, we already got this information.
But we need to customize the response a little after authentication a little bit.
This box is actually really cool.
So.
Okay.
We already got the active.
And let me copy this thing and go to the guest current user or get profile.
Move over here and say um.
For some reason.
Is active which you are I know because.
Because the reason up in here.
This is the projection.
Okay, if you say.
It's high.
This is projection and projection.
It will somehow select some data okay.
So actually that's not what we want right.
We can boost the right here.
I think we should refactor a little bit.
Instead of using the file by ID we will unify one.
And with the file one we can put it over here.
Underscore ID.
And it will be true.
Okay.
That is.
And this here also let me replenish this thing.
And replace it with current user ID.
And this here will be workload.
Yeah, yeah.
Okay so let me send again.
Okay.
Right now we already got the new information the data over here.
And let's test again with again on user okay.
So, um.
I think this should work.
Let me copy editing and test one more time.
Is that okay?
A user said okay.
So that is that's for the video and I hope you understand this video.
I will see you in the.