Hi everyone.
In this video we will think about how we can show the current reaction in 3D team right here also.
So for example, when I get on boss I want it will have the.
The some property to know what is the current reaction.
Okay so how do I know that.
Well we have a strong strategy to do that.
Let me show you what I mean.
Firstly we can create another controller.
First of all I get my reaction controller okay.
And in later in the forehand.
When we get on Mars.
Okay.
When we get on Mars with this.
And by over here, we will mark a cone to this thing one more time.
We will call the API two times and somehow override that in the front end side.
Okay.
It means we will call this thing and call this thing and do for front end size.
Okay.
What about if we have a 100 box?
It means right here we should call override.
Okay.
We will override.
100 times okay.
I don't want builders at all, right?
Instead of create and mark another cone, I want to somehow.
Modify.
Over here.
Okay.
I want it to somehow address the current and respawn back over here when we get on boss.
And we will achieve this thing.
So let me show you what I mean.
Mhm.
Right here is the file one.
This is the file one.
What we need to do right now um in here if you remember, if you remember we have a file existing.
Right between right here inside file one.
I will, uh, boost instead of one right here.
I will boost the current user.
Okay.
Watch me and you will be able to spend.
More current user over here instead of one.
I will move the current user will be user.
Okay.
And right now we need we just need to call this thing.
Or my reaction.
Take away this dot reaction service dot file.
Okay.
Right here we just need to move the box plot underscore array.
And user current user dot array.
And we will find the reaction right.
Underscore.
The screen.
But we got a different error.
We got, uh.
Right here.
Uh, because right here I unify.
Uh, let me show you in here in a bus service right here, I use the file one method.
Um, so for that reason in this case.
We need to create another method.
Okay.
We cannot use this thing.
Also, let me duplicate and I will go to file one with.
Uh, with my reaction.
And let me remove everything over here.
Remove Yeah.
So.
All right.
We already have one with my reaction.
And inside the controller we just need to go to the file by one with my reaction.
Okay.
We only use this this guy.
And with this thing we can mark it with private function because it only used inside the function over
here okay.
We can mark it with private after we already have my reaction.
Let me show you my reaction time.
Now let say.
For now I will try to drop everything.
I will do zero for consistency right now.
And after that?
After that, if I.
Get the boss.
Using this invoice.
Let me say after that we got only five because we don't have time right now, right?
And what about if I add a reaction?
Let me go with the have over here.
Say and get a boss again right here.
After we will have a halfway.
Okay.
It's mean.
This guy will be clearly about the what we want, right?
It can be undefined if it's only five.
We will not show the current reaction.
If it's half.
We will somehow override us in the front end.
Okay, that's what we want, right?
Uh, right here we will pass.
Uh, with a boss.
And my reaction will be my reaction, question mark, plot E and all that.
Because this can be undefined, right?
Undefined.
We will not care about us.
So after that.
After that, we need to fix the response to this one.
Right here.
We need to deal.
With the.
My reaction will be I read some time.
So let me say.
Right here we got internal server error.
And not read on the fly screen.
Mm.
Hmm.
Let me try one command.
Set over here.
We still have the error.
In here.
Let me say with error.
When I return, let me go back to return the boss.
For guys with this line right here will be the error.
Okay, boss.
Let me test again.
Right here we have an error.
The reason?
Because the mosque right here is not a blank desk, but work.
Okay, it's not a blank password.
Sorry.
It's not a planner object.
Okay.
Instead of this, is the object come from the rules.
So for a reason, it not work when we use the spread.
Operator.
Let me show the topic rules.
Convert.
Document to object.
Okay.
Let me start the topic over here.
We can have.
Three.
Over.
We can use the link method.
Let me show you over here I can use the link method.
Where it's already flush the object, right?
Let me say that again.
Okay.
It's already work.
Let me open the video and uncomment.
Right here.
We already have a.
My reaction will be happy.
Very very cool.
Let me create one more box.
Okay.
Some stuff like that.
And let's get on board again.
Oh, sorry.
Uh, the get onboard view doesn't have.
But let me get a bus.
Now over here.
Um, we don't have anything, so it will not solve.
Okay, you got the idea right?
Now, let's fix the get on.
Also, when I get on, I also want to attach the my reaction.
For that reason in this guy, I will do my.
Best over here.
Oh actually because the file file on right here don't use anything over here.
Right.
So for that reason we can copy directly over here.
So make sure we always use the line method to convert the Mongols into the.
Normal JavaScript object.
And right here we will boost the current users over here.
And inside the controller.
Is to get all.
We need to load the current user.
Okay.
And right here.
We will fight this thing.
Over right now will be very easy.
We just need to return the boss.
We need to map it.
To the boss.
Right here.
Okay.
Inside object.
We need to copy this thing.
Where?
It will be my reaction, right?
You will assign a function.
And after that, we need to return this here.
So.
Okay.
Only let us.
Let me get on, boss.
Mm.
Right now is not work.
Let me say why.
We are in town.
Because this is the promise.
Okay.
When we use the assign function inside the map and when we return it mean this result right here will
be the promise.
For that reason, we will say the object over here, let me show you.
For like we got And I will call boss with.
A Y chromosome.
And boost everything outside here.
Okay.
We will have.
And let me return boss with reaction.
Let me say.
Okay.
Right here is already work.
And you can say we have a my reaction and some stuff right here.
So that is that's for the video I hope you understand.
And I will see you in the.