WEBVTT

00:00.320 --> 00:05.680
So in this video we will write the logic to update the reaction count.

00:06.160 --> 00:09.400
But before that, let me test this guy.

00:09.760 --> 00:10.160
Okay.

00:10.200 --> 00:18.120
For example, if I send with the light one more time, another one, it will create the light.

00:18.240 --> 00:22.920
Okay I want it will give light normal.

00:33.840 --> 00:35.560
Reactions okay.

00:35.600 --> 00:38.760
We will not create one more thing.

00:39.200 --> 00:40.040
It would.

00:40.080 --> 00:46.200
And let me try to update if we have a new reaction.

00:50.360 --> 00:53.360
Say and let me refresh.

01:00.360 --> 01:00.840
Okay.

01:00.840 --> 01:01.920
It's already changed.

01:02.220 --> 01:06.100
So that is his early work.

01:06.740 --> 01:09.420
And right now we need to update the reaction.

01:11.100 --> 01:13.820
So how we can do that?

01:17.100 --> 01:21.820
Well, what we need to know right now, we need to somehow decrease.

01:22.580 --> 01:33.660
Decrease the count or increase the count inside the schema over here.

01:34.300 --> 01:37.460
Right inside the schema over here.

01:41.460 --> 01:42.100
Okay.

01:42.140 --> 01:44.180
So how to do that.

01:44.860 --> 01:50.980
And now let's think a little bit when we will decrease the count.

01:51.340 --> 01:55.500
Well we will decrease the count if it goes to this guy.

01:55.700 --> 01:56.220
Right.

01:56.540 --> 01:58.940
If we update the new reaction.

01:59.100 --> 02:03.920
Now for example right here we have a object.

02:04.520 --> 02:08.600
Possibly like one.

02:10.920 --> 02:12.320
One one.

02:13.880 --> 02:14.720
One zero.

02:14.960 --> 02:15.440
Okay.

02:15.640 --> 02:17.680
Furthermore, we have some stuff like that.

02:23.680 --> 02:26.520
First of all, we have some stuff like that.

02:27.160 --> 02:29.200
The lines right here will be one.

02:29.240 --> 02:29.680
Right?

02:30.600 --> 02:40.240
When we update with a new reaction I want it will decrease the curve right here and increase the curve

02:40.240 --> 02:45.680
right here, right now the mean of the sacred cow and increase the cow.

02:45.880 --> 02:52.400
So let's write it into that here to the sacred cow.

02:53.160 --> 03:01.600
Now you can say right here, in order to decrease the cow, we need to find the old the old reaction

03:01.800 --> 03:02.480
times.

03:02.520 --> 03:03.040
Right.

03:03.900 --> 03:14.340
So in this guide I will create one more variable called also as all reaction.

03:17.300 --> 03:19.740
Part will be no.

03:22.180 --> 03:32.260
And if we update right here, we will run it with the existing reaction time.

03:33.780 --> 03:38.700
And right here we need to add a little bit of script to screen.

03:39.140 --> 03:40.620
Uh no.

03:43.460 --> 03:46.580
Uh let me say okay.

03:47.540 --> 03:53.260
Now after we already have our all reaction type, we need to recreate as.

03:55.460 --> 04:00.540
Well, in order to this screencast we need to find the boss also.

04:01.140 --> 04:01.620
Okay.

04:01.660 --> 04:02.820
With the boss.

04:04.670 --> 04:07.550
Well, let's try this.

04:15.030 --> 04:15.310
Uh.

04:16.350 --> 04:17.150
Right here.

04:17.590 --> 04:22.950
We already have A51 method, which we can reuse that.

04:25.310 --> 04:27.830
Put the five one and both three.

04:30.630 --> 04:37.750
And right here, right here, we can, uh, we can check the.

04:40.590 --> 04:41.110
Over here.

04:58.870 --> 04:59.390
Okay.

05:02.870 --> 05:03.630
Provide us.

05:04.590 --> 05:04.950
Okay.

05:04.950 --> 05:07.490
We need to throw the error in here.

05:08.010 --> 05:11.170
I don't want to throw the error in here.

05:11.170 --> 05:14.410
It will increase the code base of the function.

05:14.450 --> 05:15.370
I don't want that.

05:16.690 --> 05:19.650
So after we already got the boss.

05:22.450 --> 05:23.330
We need to.

05:26.250 --> 05:27.010
Close.

05:27.210 --> 05:27.650
Okay.

05:27.650 --> 05:31.170
From the boss dot projection.

05:31.970 --> 05:32.490
Right?

05:33.330 --> 05:34.650
This is the map.

05:37.690 --> 05:41.890
And we will use this create account.

05:45.130 --> 05:51.890
Reaction count dot set with the case.

05:51.930 --> 05:54.450
The case right here will be the tie.

05:54.970 --> 05:56.930
Right where the tie.

05:56.970 --> 05:57.410
The tie.

05:57.450 --> 06:00.130
It closes this case right.

06:00.850 --> 06:06.710
So we need to call the operation tie from Here.

06:08.630 --> 06:10.830
And the value.

06:12.030 --> 06:13.510
Well, what's the value?

06:14.310 --> 06:18.190
We need to get the current value and minus one.

06:18.790 --> 06:19.430
Right.

06:19.470 --> 06:22.310
So right here I need to get the current value.

06:24.550 --> 06:26.670
Current reaction.

06:27.070 --> 06:28.710
How value.

06:30.230 --> 06:31.270
Railways.

06:32.710 --> 06:33.830
Reaction Kyle.

06:34.150 --> 06:35.110
Dot get.

06:37.230 --> 06:39.150
We need to look the case.

06:39.510 --> 06:40.150
Right.

06:43.070 --> 06:43.590
Over here.

06:49.670 --> 06:50.030
Uh.

06:50.470 --> 06:51.030
Right here.

06:51.030 --> 06:53.270
It can be known for a reason.

06:53.270 --> 06:55.470
We need to write a logic a little bit.

06:56.150 --> 07:03.950
If the our reaction time, we will boost it.

07:03.950 --> 07:04.390
K?

07:10.450 --> 07:10.770
Mm.

07:12.170 --> 07:12.570
Ah.

07:12.890 --> 07:13.370
Reason?

07:13.370 --> 07:16.370
Because we need to use AI.

07:16.530 --> 07:21.410
Reaction time over here is much better.

07:22.770 --> 07:25.490
I think I will call this here directly the value.

07:25.970 --> 07:26.450
Right.

07:26.970 --> 07:32.090
And we need to use the value over here minus one okay.

07:32.970 --> 07:35.370
Now let me summarize.

07:35.970 --> 07:46.530
If we find the overall reaction time we will get the value of plus and minus one okay.

07:47.690 --> 07:48.210
That is.

07:49.490 --> 07:54.530
And after that we need to increase with the increase.

07:54.530 --> 08:02.210
We don't need to check that because we will disagree and we need to increase at the same time.

08:02.530 --> 08:03.010
Right.

08:03.490 --> 08:07.890
So for that reason in this case we will.

08:07.890 --> 08:14.470
You must somehow undervalue him.

08:18.230 --> 08:19.070
Right here.

08:21.270 --> 08:24.150
I think I will use the zero.

08:27.230 --> 08:38.350
But if if we have a some problem, it means zero right here will be somehow minus one.

08:38.750 --> 08:41.830
Okay, that's not what we want on.

08:42.030 --> 08:45.510
For that reason, we need to check a little bit over here.

08:47.590 --> 08:49.150
Value minus one.

08:50.150 --> 08:52.350
Keep the value minus one.

08:53.910 --> 08:54.190
Uh.

08:56.630 --> 08:58.470
Greater than or equal to zero.

08:59.710 --> 09:00.430
We will.

09:02.350 --> 09:02.670
Uh.

09:04.710 --> 09:05.510
You does.

09:05.670 --> 09:12.370
If not, we will put zero right here to make sure it's bit on why the zero will be the minimum value.

09:12.730 --> 09:13.170
Okay.

09:13.930 --> 09:15.850
And increase the count.

09:16.810 --> 09:19.290
We waste something like that.

09:19.730 --> 09:23.250
We have some count set right here.

09:23.370 --> 09:25.170
We will set with the new.

09:25.770 --> 09:26.810
The new tie.

09:26.850 --> 09:27.290
Right.

09:27.690 --> 09:29.410
Will be the tie right here.

09:30.850 --> 09:33.850
And the value we define the value.

09:42.250 --> 09:43.050
Plus one.

09:44.010 --> 09:44.490
Okay.

09:44.530 --> 09:46.730
So that is.

09:47.170 --> 09:50.290
And after that we need to save into the database.

09:51.690 --> 09:52.130
Right.

09:53.370 --> 09:55.770
We will split this thing.

09:59.090 --> 09:59.410
Too.

10:06.850 --> 10:11.660
We already perform the action Directly over here.

10:14.940 --> 10:19.620
I think we should override.

10:19.740 --> 10:20.180
Okay.

10:20.180 --> 10:21.620
We override equal.

10:24.060 --> 10:27.060
And we will say goodbye.

10:28.780 --> 10:29.300
Okay.

10:36.220 --> 10:39.300
Let me go to the database and I will remove.

10:39.340 --> 10:39.700
Okay.

10:39.700 --> 10:41.060
Make sure we remove that.

10:42.700 --> 10:43.700
If not, if we will.

10:43.700 --> 10:44.940
Inconsistency.

10:46.620 --> 10:50.420
Now let me add reactions.

10:52.820 --> 10:53.700
Success.

10:54.620 --> 10:55.420
Refresh.

11:03.340 --> 11:04.900
Halfway over here.

11:05.660 --> 11:07.300
And click inside the box.

11:11.840 --> 11:15.560
Uh, the ration card, click here.

11:15.600 --> 11:16.000
Okay.

11:16.040 --> 11:19.920
We already got with the hubby will be, uh, one.

11:20.160 --> 11:21.200
Very, very good.

11:21.720 --> 11:23.240
Let me change.

11:23.400 --> 11:27.880
Let me click one more time to make sure it will not somehow.

11:29.920 --> 11:30.920
Increase.

11:39.120 --> 11:39.520
Okay.

11:39.520 --> 11:40.360
It's the one.

11:40.960 --> 11:41.480
The reason.

11:41.480 --> 11:45.360
Because we already return immediately over here.

11:47.040 --> 11:51.400
Okay, now let's remove us to like.

11:54.360 --> 11:55.360
Let's refresh.

12:04.560 --> 12:04.960
Okay.

12:04.960 --> 12:11.200
The hubby already become a zero and the like we will increase by one.

12:12.300 --> 12:14.260
And so the reaction's.

12:17.820 --> 12:19.140
Over with the like.

12:19.260 --> 12:28.180
So that is just how we can add the reaction into the box, right?

12:28.580 --> 12:39.500
And for sure in later when we get on a box we want will return the the count.

12:39.900 --> 12:40.420
Right.

12:40.580 --> 12:42.820
I will leave that aside for you.

12:42.940 --> 12:43.460
Okay.

12:43.580 --> 12:50.940
Let's return the object reaction count right here in the UI.

12:53.260 --> 12:55.540
So I will do that in the next video.

12:56.220 --> 12:57.820
I hope you understand this video.

12:57.860 --> 13:02.140
Okay, so if not, let's take a closer look at the logic.

13:02.340 --> 13:08.140
I already commented in very detail and explain the detail also, right?

13:09.020 --> 13:10.820
So I hope you very clear.

13:11.980 --> 13:13.500
I will see you in the next one.
