1
00:00:07,900 --> 00:00:09,070
Welcome back.

2
00:00:09,100 --> 00:00:13,760
In this video, let's see how we can create a function to register.

3
00:00:13,780 --> 00:00:18,760
So back to the context that is a C component.

4
00:00:18,760 --> 00:00:24,100
And then inside the context and the of context and this is what we want.

5
00:00:24,400 --> 00:00:28,770
So here we are going to create a function for registration.

6
00:00:28,780 --> 00:00:35,560
Before we continue, let's require the action type for register sex and then register field.

7
00:00:35,650 --> 00:00:37,120
So here we go.

8
00:00:37,270 --> 00:00:43,030
Let's require the register sex and then the register field.

9
00:00:43,060 --> 00:00:46,380
Now let's close the action types.

10
00:00:47,410 --> 00:00:47,800
All right.

11
00:00:47,800 --> 00:00:48,130
Right.

12
00:00:48,130 --> 00:00:49,600
So now back here.

13
00:00:50,080 --> 00:00:57,290
So what we are going to do is that we are going to follow the same format for logging in so we can even

14
00:00:57,340 --> 00:00:59,950
copy this one and make some changes.

15
00:00:59,950 --> 00:01:00,800
And that is all.

16
00:01:00,820 --> 00:01:03,220
So here, let's copy this one.

17
00:01:03,220 --> 00:01:10,330
And down here, let's paste it here and let's change this one to register user action.

18
00:01:10,570 --> 00:01:10,990
Great.

19
00:01:10,990 --> 00:01:14,890
And the same thing I'm passing in the config by the end point.

20
00:01:14,930 --> 00:01:17,230
Going to be forced slash register.

21
00:01:17,620 --> 00:01:20,010
Do you remember under API development?

22
00:01:20,020 --> 00:01:23,320
In case you are confused, this the end point.

23
00:01:23,320 --> 00:01:31,150
Let me show you at the back end here and the collections users and then register its forward slash register.

24
00:01:31,270 --> 00:01:36,280
So here we are dispatching what is called register sex.

25
00:01:37,810 --> 00:01:41,740
And down here we add this patch in the.

26
00:01:42,910 --> 00:01:44,230
Register felt.

27
00:01:44,710 --> 00:01:51,390
So I think for logging in let's provide the constant log in field.

28
00:01:51,400 --> 00:01:51,990
Yeah.

29
00:01:52,000 --> 00:01:54,610
And that is it guys and that is it.

30
00:01:54,610 --> 00:02:00,310
So let's send this one to the component as register user action.

31
00:02:00,490 --> 00:02:07,060
The last step is we need to handle the reducer and the same way we did for logging in the same thing

32
00:02:07,060 --> 00:02:17,980
for register also so we can copy from case success and then case field and that is it.

33
00:02:17,980 --> 00:02:21,280
So the register must come first before logging in.

34
00:02:21,280 --> 00:02:24,310
So I'll paste it here and here.

35
00:02:24,310 --> 00:02:31,570
I'm going to make it as register and here is going to be register sex.

36
00:02:32,480 --> 00:02:36,560
And down here is going to be register filled.

37
00:02:37,400 --> 00:02:41,990
I'm not going to look in the user automatically, so I'm going to remove this one from here.

38
00:02:42,530 --> 00:02:43,060
Great.

39
00:02:43,070 --> 00:02:44,840
So here, let's look at it.

40
00:02:44,840 --> 00:02:45,490
State here.

41
00:02:45,500 --> 00:02:47,890
Everything is correct and everything is correct.

42
00:02:47,900 --> 00:02:49,070
Everything is correct.

43
00:02:49,070 --> 00:02:51,440
And for fail to, everything is correct.

44
00:02:51,470 --> 00:02:53,450
Now we are all set.

45
00:02:53,780 --> 00:02:57,350
The last thing is I need to dispatch this action.

46
00:02:57,350 --> 00:03:00,260
So back to the register component.

47
00:03:00,290 --> 00:03:02,870
Make sure that you have the register action.

48
00:03:02,870 --> 00:03:06,410
So after success, I want to redirect the user.

49
00:03:06,410 --> 00:03:09,260
So I will change this one to log in.

50
00:03:09,260 --> 00:03:10,250
And that is it.

51
00:03:10,640 --> 00:03:12,260
Lower case log in.

52
00:03:13,100 --> 00:03:15,050
So let's have a look.

53
00:03:15,080 --> 00:03:17,930
Moment of truth inside the register.

54
00:03:17,930 --> 00:03:21,320
Component forms and register.

55
00:03:21,830 --> 00:03:26,270
So here let's bring the of context and then the use context.

56
00:03:29,030 --> 00:03:30,650
And here we go.

57
00:03:30,890 --> 00:03:36,200
So now inside the register, let's create instance of that.

58
00:03:37,500 --> 00:03:43,420
Let's bring the youth context and they pass in the off context and what comes back.

59
00:03:43,440 --> 00:03:45,390
What I want is the.

60
00:03:47,360 --> 00:03:48,500
Registered user.

61
00:03:48,500 --> 00:03:51,920
Let me check the name again, which is this one.

62
00:03:52,790 --> 00:03:54,740
And I also need the error also.

63
00:03:54,740 --> 00:04:04,160
So I'm going to grab the register action and then the arrow and that is it equal to that.

64
00:04:04,370 --> 00:04:08,750
So inside the submit this word, I'm going to dispatch the action.

65
00:04:08,750 --> 00:04:13,250
So let me bring this one here and down here.

66
00:04:13,280 --> 00:04:21,470
Let me call the register user action and pass in the fourth data, which is my form states.

67
00:04:21,709 --> 00:04:23,750
And that is it, guys.

68
00:04:23,840 --> 00:04:25,850
So let's check it out.

69
00:04:25,910 --> 00:04:27,620
Registration is coming.

70
00:04:27,980 --> 00:04:30,230
Provide this one as cc.

71
00:04:30,920 --> 00:04:35,270
Full name cc and password.

72
00:04:35,270 --> 00:04:36,920
One, two, three, four, five.

73
00:04:37,220 --> 00:04:38,090
Register.

74
00:04:39,030 --> 00:04:42,300
And you can see that it has been heart rate directed.

75
00:04:42,300 --> 00:04:45,560
And if I check the storage, let's see.

76
00:04:45,570 --> 00:04:50,820
Well, there is no talking here because I'm not saving the talking in the storage.

77
00:04:51,000 --> 00:04:55,250
If I log in with see, see, let's see, see, see.

78
00:04:55,290 --> 00:04:56,910
X gmail.com.

79
00:04:58,110 --> 00:04:58,830
Password.

80
00:04:58,830 --> 00:05:00,420
One, two, three, four, five.

81
00:05:01,800 --> 00:05:06,270
And you can see that I have no account being added and that is it.

82
00:05:06,270 --> 00:05:11,670
So what we want to work on is this one, let's see that it is that don't have any accounts, you don't

83
00:05:11,670 --> 00:05:18,210
want to show this one and you want to calculate the total income expenses if the person have an account

84
00:05:18,240 --> 00:05:21,090
as we did for the individual account.

85
00:05:21,090 --> 00:05:22,170
So that is it.

86
00:05:22,350 --> 00:05:26,910
So what has left is about able to create an account, right?

87
00:05:26,910 --> 00:05:29,490
So let's get into that in the next video.

