WEBVTT

00:00.520 --> 00:02.040
Hi everyone.

00:02.040 --> 00:13.560
In this video, let's go to the notification service and create a method for creating notifications.

00:14.120 --> 00:14.600
Okay.

00:15.360 --> 00:20.120
And right now we don't need any resolver query notification.

00:20.360 --> 00:20.880
Why?

00:21.280 --> 00:25.160
Because right now we need to route directly.

00:28.240 --> 00:29.320
Data over here.

00:30.160 --> 00:30.640
Okay.

00:33.160 --> 00:33.720
Why?

00:34.400 --> 00:36.840
The reason is very simple.

00:36.880 --> 00:44.720
Because we don't have any controller for creating the notification service okay.

00:46.040 --> 00:56.600
Instead what we do we will use the method right here in our sys module okay.

00:56.640 --> 01:01.100
For example line Reaction module.

01:01.620 --> 01:02.180
Okay.

01:02.420 --> 01:13.420
When we click into the reaction, we need to call the notification service dot create notification and

01:13.420 --> 01:15.740
it will create a notification okay.

01:16.580 --> 01:26.060
For that reason we don't have any controller and we don't need this also for the reason.

01:26.060 --> 01:28.740
In this case let me say what we need.

01:28.780 --> 01:37.300
Firstly we need the sender ID and we need to send the ID over here receiver array.

01:39.260 --> 01:39.780
And.

01:45.060 --> 01:45.820
The type.

01:47.980 --> 01:48.700
Of the I.

01:51.060 --> 01:52.580
Notification type.

01:56.020 --> 01:56.980
And content.

02:02.470 --> 02:07.670
Without this is read with this link to edit.

02:08.630 --> 02:10.630
Link to edit right here can be undefined.

02:10.670 --> 02:13.390
Okay, we can put that or not.

02:14.590 --> 02:20.070
It totally depends on the tie over here.

02:22.430 --> 02:24.190
I will call string.

02:26.710 --> 02:27.230
Okay.

02:28.430 --> 02:32.550
And we need to inject the notification module.

02:34.990 --> 02:36.470
Model over here.

02:37.510 --> 02:45.390
Now that we are over the pass in service we moved over here.

02:46.470 --> 02:47.190
Remove.

02:55.530 --> 02:57.050
Import notification.

03:07.130 --> 03:07.690
Okay.

03:09.970 --> 03:21.890
After us inside the create method and we will call notification equal equal new list dot notification

03:21.890 --> 03:22.530
model.

03:23.490 --> 03:25.570
And we need to put everything.

03:29.330 --> 03:30.010
Over here.

03:33.290 --> 03:33.810
Okay.

03:34.770 --> 03:36.610
After us it looks like.

03:41.810 --> 03:43.810
And of course we need to send.

03:47.410 --> 03:51.170
We need to send this thing in real time.

03:51.170 --> 03:51.570
Right.

03:58.340 --> 04:00.020
I will show you how to do that.

04:00.020 --> 04:00.620
Like that.

04:01.780 --> 04:04.980
Right now let's use the create method.

04:08.180 --> 04:12.300
Right here inside on controller.

04:12.300 --> 04:14.700
We don't have any controller for create.

04:14.860 --> 04:20.620
We only have the controller for Mark three.

04:20.980 --> 04:21.460
Okay.

04:22.060 --> 04:23.140
We will use it.

04:23.460 --> 04:24.700
We will go right.

04:24.700 --> 04:25.740
We need to update.

04:25.860 --> 04:31.540
We will have a controller for update okay.

04:32.180 --> 04:33.780
All we need to do that.

04:34.100 --> 04:38.220
And maybe we will have Mark on notification.

04:39.780 --> 04:40.340
Right.

04:40.740 --> 04:42.380
Press will be show okay.

04:43.100 --> 04:47.940
So we only have two controller okay.

04:47.940 --> 04:53.520
So for result in this guy we only need to Use the batch.

04:54.560 --> 04:58.280
And actually we have a one more thing we will get.

04:59.920 --> 05:03.160
Oh sorry read user notification.

05:06.320 --> 05:12.480
Also okay so right here let me say we need to.

05:14.560 --> 05:20.240
Here here here and remove here okay.

05:20.720 --> 05:22.840
We only need three method.

05:24.080 --> 05:27.080
Maybe we also don't need the five one.

05:27.760 --> 05:28.120
Okay.

05:28.120 --> 05:29.280
Let me remove the file one.

05:29.320 --> 05:33.360
Also if we need I will go back and create.

05:35.640 --> 05:38.360
Let remove on you in touch.

05:39.120 --> 05:43.080
And let's say how we can create a notification.

05:45.680 --> 05:50.850
Well in order to create a notification Finally, we need to inject that.

05:51.890 --> 05:59.610
For example, uh, R1 send a notification when the user react.

06:03.410 --> 06:03.970
Okay.

06:05.570 --> 06:05.930
Um.

06:07.970 --> 06:21.210
Let me say in here inside the box a bit, we have a method for art reaction.

06:22.970 --> 06:23.410
Okay.

06:23.410 --> 06:28.610
I will send the notification when the user reaction.

06:29.090 --> 06:29.610
Right.

06:30.410 --> 06:31.890
It means after here.

06:32.650 --> 06:44.690
Firstly we need to inject the notification shove it and notification service or notification module

06:44.730 --> 06:53.030
right here should be global More because I don't want people thus again and again and again.

06:53.390 --> 07:01.950
Okay, so for that reason in here, firstly we need to extract the notification service.

07:02.550 --> 07:08.550
And after that we need to mark this here will be global okay.

07:08.910 --> 07:16.550
With this thing we don't need to import the notification module outside okay.

07:16.710 --> 07:20.910
We don't need to manually invoke notification module over here.

07:23.750 --> 07:25.270
Right here inside.

07:27.550 --> 07:36.950
The notification service let me inject notification service.

07:43.390 --> 07:46.880
And let me run the application to Does it have error or not?

08:10.480 --> 08:17.440
It have error because I forgot to import the.

08:19.760 --> 08:23.320
Schema into the module after notification.

08:28.080 --> 08:31.200
Ah, maybe I will copy from ah.

08:33.640 --> 08:35.640
Boss module over here.

08:37.640 --> 08:38.080
I will go.

08:43.300 --> 08:43.780
Moreover.

09:00.820 --> 09:01.940
Let us.

09:07.620 --> 09:09.620
Forget the obligation of work.

09:11.020 --> 09:14.700
Let's go and go to the bus service.

09:15.900 --> 09:16.380
Right here.

09:16.380 --> 09:18.380
Let's see how we can improve.

09:19.420 --> 09:20.780
How we can use that.

09:24.700 --> 09:25.220
For life.

09:25.220 --> 09:25.740
Right here.

09:26.060 --> 09:27.100
What is the sender?

09:27.100 --> 09:30.540
And the sender idea will come from the current user over here.

09:30.580 --> 09:31.060
Right.

09:32.900 --> 09:33.380
And.

09:37.260 --> 09:39.900
What is the receiver.

09:39.900 --> 09:41.260
End result.

09:41.430 --> 09:45.670
received a call from the whole creator box right here.

09:46.190 --> 09:46.670
Right.

09:47.270 --> 09:48.230
Let me show you.

09:48.630 --> 09:49.390
What do you mean?

09:50.750 --> 09:52.710
I will send a notification.

09:52.990 --> 09:54.710
This notification.

09:54.750 --> 09:55.310
Sorry.

09:55.870 --> 09:56.350
Don't.

09:59.310 --> 10:00.030
Cry.

10:01.030 --> 10:01.550
Okay.

10:02.150 --> 10:03.630
What will be the sender address?

10:14.710 --> 10:15.230
Okay.

10:15.830 --> 10:17.670
And what is the receiver ID?

10:17.790 --> 10:18.710
Let me see.

10:20.350 --> 10:21.790
Right here we have a boss.

10:23.910 --> 10:25.950
Bot over here.

10:27.030 --> 10:27.550
Okay.

10:27.870 --> 10:30.310
If you remember, these are the boss schema.

10:30.590 --> 10:31.390
Let me open it.

10:34.470 --> 10:35.990
We have the author.

10:36.630 --> 10:37.150
Okay.

10:37.310 --> 10:41.010
So for this guy, we can work both on.

10:43.410 --> 10:45.090
And off screen.

10:46.090 --> 10:46.650
All right.

10:47.370 --> 10:50.450
And with the tile, the tile here would be for sure.

10:50.810 --> 10:51.410
Would be.

10:54.210 --> 10:57.890
Like, actually we should use the reaction.

10:58.170 --> 10:58.490
Mm.

11:00.530 --> 11:01.410
Sorry for that.

11:01.410 --> 11:10.250
Let me change the reaction and change this here into reaction.

11:13.170 --> 11:13.690
Okay.

11:14.730 --> 11:22.690
Let us mode reaction and the content.

11:22.730 --> 11:26.330
What's the content where the content will be.

11:26.370 --> 11:30.330
Uh let me boost let me create content.

11:37.540 --> 11:41.500
How will you demonstrate whoever is a.

11:47.500 --> 11:52.140
Current user dot name.

11:54.300 --> 11:55.940
Plus react.

12:06.220 --> 12:07.060
Maybe.

12:09.620 --> 12:12.140
This is a type I reaction time.

12:17.220 --> 12:19.300
Okay we have this here.

12:22.580 --> 12:27.340
So first I will copy the type here class react.

12:30.180 --> 12:33.740
So the vast.

12:38.080 --> 12:39.640
And come over here.

12:39.680 --> 12:42.760
Buddha's rock.

12:44.280 --> 12:47.960
And one more base remains.

12:50.880 --> 12:52.920
The link to ID, right?

12:53.560 --> 12:55.000
What's the link to it?

12:55.000 --> 13:01.080
For sure will be the boss, underscore and Turtle Street.

13:02.720 --> 13:03.280
Okay.

13:03.960 --> 13:08.320
And make sure we await us, because this is a synchronous operation.

13:10.840 --> 13:13.080
With this here, we already have.

13:13.440 --> 13:13.920
Right.

13:15.480 --> 13:16.640
So let's.

13:17.000 --> 13:17.560
That is.

13:29.520 --> 13:31.080
Let me check that by.

13:42.730 --> 13:43.890
Click on boss.

13:46.170 --> 13:46.730
And.

13:59.970 --> 14:02.850
I will copy this idea of the boss over here.

14:06.290 --> 14:07.690
And go to.

14:10.570 --> 14:11.130
The.

14:19.970 --> 14:21.050
Aria, sir.

14:24.410 --> 14:24.850
In here.

14:24.850 --> 14:26.010
Let's replace the boss.

14:26.650 --> 14:27.170
Okay.

14:27.970 --> 14:30.090
And I will be happy.

14:31.010 --> 14:31.530
Okay.

14:32.390 --> 14:34.590
And, uh, one more thing.

14:39.190 --> 14:39.950
One more thing.

14:39.950 --> 14:41.230
Which is, uh.

14:43.470 --> 14:47.830
The authentication with authentication with the Thomas account.

14:53.270 --> 14:57.550
Because this is the post of the zone.

14:57.590 --> 14:58.110
Right?

15:00.630 --> 15:05.670
Now, let me say we already got the success.

15:06.270 --> 15:09.150
And let me check the value of the notifications.

15:13.790 --> 15:19.990
Now you can say, uh, right here, but we don't have any.

15:23.310 --> 15:24.070
Reaction.

15:28.350 --> 15:30.920
Well, we have a little bit of a roll over here.

15:38.960 --> 15:40.560
We don't have any.

15:44.080 --> 15:48.320
Standard ID or auto ID, right?

15:49.160 --> 15:50.360
Why not?

15:52.720 --> 15:54.160
Uh, let me try that.

15:56.120 --> 15:56.520
Ah.

15:58.200 --> 16:00.880
The reason, because this is should be the center.

16:01.680 --> 16:02.200
Okay.

16:02.240 --> 16:05.200
And so this will be receiver.

16:05.760 --> 16:06.400
My bad.

16:08.760 --> 16:09.480
Let me.

16:12.640 --> 16:13.520
Remove.

16:17.520 --> 16:18.920
The notifications.

16:24.560 --> 16:26.120
And let me click again.

16:31.300 --> 16:31.780
Right here.

16:31.780 --> 16:37.460
You can say if I use exactly the same time, it will prevent.

16:38.420 --> 16:40.700
It will also prevent over here.

16:46.980 --> 16:49.100
It will auto play right over here.

16:49.100 --> 16:54.460
So for this guy I will change to uh, like say.

16:56.500 --> 16:57.740
After that let's check.

17:11.140 --> 17:11.700
Okay.

17:11.700 --> 17:17.740
We already got the sender ID and receiver IDs.

17:18.260 --> 17:18.860
Right?

17:19.300 --> 17:19.980
Receiver.

17:19.980 --> 17:21.780
They should be the Thomas.

17:22.180 --> 17:25.580
Let me click inside the users.

17:28.950 --> 17:29.550
Oh, sorry.

17:31.550 --> 17:33.550
I should be the account.

17:33.590 --> 17:33.990
Okay.

17:34.590 --> 17:35.270
Over here.

17:35.510 --> 17:35.990
Okay.

17:44.630 --> 17:45.190
Okay.

17:45.910 --> 17:48.550
And the sender address should be the Thomas for sure.

17:52.310 --> 17:52.870
Okay.

17:53.430 --> 17:53.910
That is.

17:54.110 --> 17:57.750
And this is our boss.

17:58.070 --> 18:08.750
And we can base all the information to, uh, redirect it into the ID, into the post with this ID on

18:08.790 --> 18:09.590
the front end.

18:09.630 --> 18:11.110
Right in the front end.

18:11.110 --> 18:13.550
You just need to use some routers.

18:14.710 --> 18:15.230
Okay.

18:15.630 --> 18:18.510
To link with this URL.

18:20.070 --> 18:22.910
And I hope you understand this video.

18:23.270 --> 18:24.950
So I will see you in the next.
