1
00:00:00,180 --> 00:00:00,600
Beautiful.

2
00:00:00,870 --> 00:00:06,570
And once we can remove the drum, it's also set up the functionality on a end where we can edit the

3
00:00:06,570 --> 00:00:06,930
job.

4
00:00:07,260 --> 00:00:12,930
Now the biggest difference between the two is the simple fact that when it comes to delete, we're actually

5
00:00:12,930 --> 00:00:21,360
calling this in the component that if you remember when it comes to edit, we navigate to our job and

6
00:00:21,360 --> 00:00:24,000
this is where we set up the functionality.

7
00:00:24,240 --> 00:00:30,420
This is where we invoke the ad job or added job in the ad up page.

8
00:00:30,900 --> 00:00:32,220
And where I'm going with this.

9
00:00:32,610 --> 00:00:39,330
Well, remember, first of all, you have here of the alert and second, when it comes to error.

10
00:00:39,630 --> 00:00:41,190
This is also where we'll display it.

11
00:00:42,030 --> 00:00:46,110
So long story short, yes, in this case, we'll have all of them.

12
00:00:46,590 --> 00:00:54,030
We have added jump again the success as well as the error, simply because we're working in a different

13
00:00:54,030 --> 00:01:01,980
component when it comes to invoking the functionality here with the way it was in the old jobs, and

14
00:01:02,010 --> 00:01:05,040
I'll be switching to the added job.

15
00:01:05,489 --> 00:01:07,540
So let's take a look at the read me.

16
00:01:08,010 --> 00:01:09,120
What are the steps?

17
00:01:09,630 --> 00:01:12,030
And essentially, here's what I want to do.

18
00:01:13,440 --> 00:01:17,730
First, we want to set up the actions in the action address.

19
00:01:17,940 --> 00:01:21,960
So on, we're at a job against success on our career.

20
00:01:21,960 --> 00:01:22,680
That makes sense.

21
00:01:23,130 --> 00:01:30,630
Then we have our added job function where we dispatch at a job again, which will set up the loading

22
00:01:31,080 --> 00:01:31,370
van.

23
00:01:31,380 --> 00:01:34,890
Remember, all of our values are already in the state.

24
00:01:36,030 --> 00:01:43,320
The positions companies everything up to the status, so we're just it out of a state and land the same

25
00:01:43,320 --> 00:01:43,620
deal.

26
00:01:43,980 --> 00:01:50,420
We got jobs and in there we need to pass in the prime, the job.

27
00:01:51,210 --> 00:01:55,230
And where is it sitting there, just sitting in the edit jump?

28
00:01:56,250 --> 00:02:02,100
Either you pull it out here when we're restructuring or it can just go and stay dot and then had a job

29
00:02:02,370 --> 00:02:06,390
since I already have the flowers in front and we might as well send them now.

30
00:02:06,390 --> 00:02:08,430
In some cases, the user will change the rules.

31
00:02:08,729 --> 00:02:14,220
In some there will be equal to the defaults we already have on a server that is irrelevant.

32
00:02:14,700 --> 00:02:21,780
What we need to do from the front end is pass all the data just in case the values are different than

33
00:02:21,780 --> 00:02:22,950
the ones on a server.

34
00:02:23,860 --> 00:02:32,810
And then we'll dispatch added job success, which essentially introducer just sets up the alert, so

35
00:02:32,840 --> 00:02:36,430
alert true success and we'll just say job updated.

36
00:02:36,850 --> 00:02:39,160
So user knows, OK, everything works.

37
00:02:39,520 --> 00:02:44,720
And also, I want to dispatch clear values because if everything is correct.

38
00:02:44,770 --> 00:02:47,260
Well, I don't want that at a job.

39
00:02:47,350 --> 00:02:48,760
They're lingering around.

40
00:02:49,240 --> 00:02:50,870
I just want to set it back to default.

41
00:02:51,380 --> 00:02:52,800
Then we have also error.

42
00:02:53,110 --> 00:02:56,440
This is going to be the case where if we have 401.

43
00:02:56,590 --> 00:02:57,820
We're not going to display that.

44
00:02:57,970 --> 00:03:00,010
I'm not going to repeat why we're doing that.

45
00:03:00,340 --> 00:03:04,300
Please go to the previous videos where I covered up a much greater detail.

46
00:03:04,660 --> 00:03:09,310
And if the error is not for one, then we dispatch there.

47
00:03:09,790 --> 00:03:13,840
It might be a value missing or something along those lines.

48
00:03:13,850 --> 00:03:15,670
But let me just double check.

49
00:03:16,150 --> 00:03:19,810
I believe that on the front end, we're checking for all the values.

50
00:03:19,840 --> 00:03:21,160
Let me quickly navigate there.

51
00:03:22,330 --> 00:03:27,490
I'm looking for two pages and I want to look for an odd job, and let's see.

52
00:03:27,700 --> 00:03:34,660
Yeah, no rush here, so I'm checking for two empty hours, so the chances of some kind of error are

53
00:03:34,660 --> 00:03:39,220
obviously much slimmer right now if we remove this than we definitely contested.

54
00:03:39,220 --> 00:03:39,400
OK?

55
00:03:39,850 --> 00:03:40,590
So let's do it.

56
00:03:40,600 --> 00:03:48,280
We're going to first go to the actions and let's see which one I can quickly grab.

57
00:03:48,280 --> 00:03:50,740
So added, I'm going to take these ones.

58
00:03:51,760 --> 00:03:59,350
Now I just need to challenge the creator over here, so let me so let this one select all of them,

59
00:03:59,740 --> 00:04:01,450
and we're just going to go at it.

60
00:04:02,240 --> 00:04:07,540
We have this wandering place than we want to go to this reducer.

61
00:04:07,780 --> 00:04:12,690
Now, I'm not going to set up the logic right now, but I'll just start by getting all of them sort

62
00:04:12,700 --> 00:04:13,240
of begin.

63
00:04:13,810 --> 00:04:15,040
Then I want success.

64
00:04:15,460 --> 00:04:18,250
And I also want our van.

65
00:04:18,250 --> 00:04:20,529
Let me take all of them.

66
00:04:20,680 --> 00:04:22,570
And back in the app context.

67
00:04:23,660 --> 00:04:24,920
Also, let's import them.

68
00:04:26,400 --> 00:04:30,510
And let's keep on scrolling, and what we're looking for is the added jump.

69
00:04:31,340 --> 00:04:32,960
And let's set up the functionality.

70
00:04:33,350 --> 00:04:39,800
First thing we want to do in this patch and we're going to dispatch type and begin type will be equal

71
00:04:39,800 --> 00:04:42,890
to edit job and begin.

72
00:04:43,490 --> 00:04:48,500
So we'll set up the loading OK, then we want to go and try and catch.

73
00:04:50,070 --> 00:04:51,420
Let's go with the cast.

74
00:04:52,550 --> 00:04:54,020
And let's pull out of ours.

75
00:04:54,170 --> 00:05:00,050
So I'm looking for a position and all of that will be coming from the state.

76
00:05:01,010 --> 00:05:05,120
So position first one company than a job.

77
00:05:06,020 --> 00:05:11,300
Location and also job type and the status.

78
00:05:11,880 --> 00:05:16,400
Again, if you want to pull out the I.D. as well, you can definitely do so in my case.

79
00:05:16,760 --> 00:05:18,080
We're going to go stay dot.

80
00:05:18,650 --> 00:05:23,780
Then we want to go with a weight and remember, we're not really looking for that response.

81
00:05:24,330 --> 00:05:27,650
So let me double check my controller.

82
00:05:28,010 --> 00:05:36,110
So we are sending back the updated job, but we really don't care about it because if everything is

83
00:05:36,110 --> 00:05:43,490
correct, we'll just display the message and remember when we navigate back to all jobs will refresh

84
00:05:43,490 --> 00:05:46,070
the jobs anyway, and then we'll see that there.

85
00:05:46,580 --> 00:05:47,780
Hopefully that makes sense.

86
00:05:48,230 --> 00:05:50,810
So let me go back to context again.

87
00:05:50,990 --> 00:05:56,510
We're not going to assign this to any kind of variable because I'm just waiting for this to complete.

88
00:05:56,780 --> 00:05:59,000
So we're going to go here with OFSUCH.

89
00:06:00,150 --> 00:06:06,390
One remember, the method is patch, and then we need to pass in the Yoro in this case, since I'll

90
00:06:06,390 --> 00:06:08,640
be providing the interpolation.

91
00:06:09,000 --> 00:06:10,760
I also want to go with template strings.

92
00:06:10,770 --> 00:06:15,840
We set up jobs online, let's access state online.

93
00:06:15,840 --> 00:06:24,430
We're looking for edit job and then I'd have me double check just so there are no silly bugs.

94
00:06:24,750 --> 00:06:31,830
So edit job video make sure it's exactly the same because I'm an expert on making such a small typo.

95
00:06:31,830 --> 00:06:33,450
So yeah, it's about right.

96
00:06:33,870 --> 00:06:34,070
And.

97
00:06:34,830 --> 00:06:38,640
Since we have the patch functionality, we need to pass in some data.

98
00:06:39,580 --> 00:06:42,820
Now, what a while on a passing company position.

99
00:06:43,770 --> 00:06:48,900
Also, a job location sounds nice, van, I also want to pass in the job type.

100
00:06:49,320 --> 00:06:53,070
Lastly, let's go with starters, let's save it.

101
00:06:53,430 --> 00:06:59,010
And if everything is correct, I want to wipe out the value now in this case again.

102
00:06:59,310 --> 00:06:59,970
My apologies.

103
00:07:00,300 --> 00:07:03,360
For some reason, I keep forgetting that this is a sink.

104
00:07:03,990 --> 00:07:05,880
So let's go here with a sink.

105
00:07:06,330 --> 00:07:07,680
This should fix the error.

106
00:07:08,220 --> 00:07:16,470
And remember, once we are successful, I also want to set it back to default when it comes to our job.

107
00:07:16,950 --> 00:07:23,040
And if you remember, we already have the action for that and that one is clear.

108
00:07:24,000 --> 00:07:30,360
So we wait for this one to complete and then we go with this batch and then let's just go with type.

109
00:07:31,850 --> 00:07:34,250
And I'll set it equal to clear.

110
00:07:35,060 --> 00:07:39,440
Let's save it, and let's do the whole song and dance with our response.

111
00:07:39,890 --> 00:07:45,050
First of all, if it's for a one that I don't want to spread the word, so we're going to go with our

112
00:07:45,410 --> 00:07:48,800
then response and we're looking for status.

113
00:07:49,100 --> 00:07:56,850
And if that one is equal to for a one, then simply return, then I want to dispatch if it's not for

114
00:07:56,870 --> 00:07:57,110
one.

115
00:07:57,590 --> 00:08:04,460
For example, if it's 400, in this case, we're going to go type that is equal to edit job and are

116
00:08:04,700 --> 00:08:06,890
not begin looking for the error.

117
00:08:07,200 --> 00:08:09,230
And then let's pass in the payload.

118
00:08:09,440 --> 00:08:19,640
We're going to go here with a object and set up a message, and let's set it equal to our response then

119
00:08:19,720 --> 00:08:20,270
data.

120
00:08:20,720 --> 00:08:21,920
That's where it's going to be sitting.

121
00:08:22,280 --> 00:08:23,330
And the message?

122
00:08:23,630 --> 00:08:30,410
And once we have the error in place, I'm noticing that actually skipped one step, not at a job success.

123
00:08:30,920 --> 00:08:37,190
Now, unlike the alert, we're not going to pass anything here in the payload, but we still want to

124
00:08:37,190 --> 00:08:39,320
dispatch it to go in this batch.

125
00:08:40,289 --> 00:08:47,070
When we're looking for type and we're going to go with added job and success, essentially with this

126
00:08:47,070 --> 00:08:49,410
one, we're just setting up that alert.

127
00:08:49,740 --> 00:08:54,900
And when it comes to clearing devours, well, we already know that we're going to do that with the

128
00:08:54,900 --> 00:08:55,680
next dispatch.

129
00:08:56,100 --> 00:09:02,370
And then since I want to hide those alerts, I'm going to go with clear alert and then let's invoke

130
00:09:02,370 --> 00:09:02,490
it.

131
00:09:03,060 --> 00:09:06,690
And with this in place now, let's navigate to the reducer.

132
00:09:07,320 --> 00:09:11,260
And I don't know which one I can copy, which is going to be faster.

133
00:09:11,760 --> 00:09:18,570
I think I'm going to take the set up user error because I mean, most of them will be based on that.

134
00:09:19,080 --> 00:09:22,500
So with me, navigate down here, copy and paste.

135
00:09:22,950 --> 00:09:32,890
Now the action that I'm looking for is a job and then begin with take this one, edit on the score job

136
00:09:32,910 --> 00:09:33,240
again.

137
00:09:33,630 --> 00:09:38,100
But you know, before we do anything, going to copy and paste because there's a bunch of things are

138
00:09:38,100 --> 00:09:39,330
going to be exactly the same.

139
00:09:39,330 --> 00:09:43,080
So at a job begin, let's just leave it as far as loading.

140
00:09:43,290 --> 00:09:45,720
But let's set it up as true.

141
00:09:46,780 --> 00:09:49,300
So when we performed this request, it's going to be loading.

142
00:09:49,750 --> 00:09:55,300
That's going to be the beginning one, then as far as the success or we just want to display the message,

143
00:09:55,300 --> 00:09:59,260
that's why we're not passing anything and there's really not much to pass.

144
00:09:59,680 --> 00:10:02,350
So in here, let's just say, is loading false?

145
00:10:03,410 --> 00:10:03,970
True.

146
00:10:04,180 --> 00:10:05,260
It's not going to be a danger.

147
00:10:05,530 --> 00:10:06,930
It's actually going to be success.

148
00:10:07,210 --> 00:10:13,120
But what's again, copy and paste, because this actually matches exactly what we need for the error.

149
00:10:13,770 --> 00:10:15,310
And let me fix this one quickly.

150
00:10:15,790 --> 00:10:19,120
So alert text will be job and not updated.

151
00:10:19,510 --> 00:10:21,070
That's the exclamation point.

152
00:10:21,470 --> 00:10:24,430
And then let's say here, success.

153
00:10:24,940 --> 00:10:26,250
Let's save this.

154
00:10:26,260 --> 00:10:28,210
And lastly, what about the error?

155
00:10:28,720 --> 00:10:37,630
Well, pretty much already have all of the code we go with state loading, false show or true danger.

156
00:10:37,870 --> 00:10:41,020
And where is the message sending in the message?

157
00:10:41,020 --> 00:10:41,470
Probably.

158
00:10:41,740 --> 00:10:43,210
Let me go back to my application.

159
00:10:43,570 --> 00:10:45,460
I'm looking for all my jobs.

160
00:10:45,910 --> 00:10:49,000
Let's say that I want to edit this one.

161
00:10:49,030 --> 00:10:53,020
The intern and Apple, and I'll start by changing the status.

162
00:10:53,510 --> 00:10:54,810
I'm going to go to interview.

163
00:10:55,360 --> 00:10:57,370
Maybe let's also change the position.

164
00:10:57,670 --> 00:11:00,280
It's going to be a front end one.

165
00:11:01,650 --> 00:11:07,380
And the job location, well, for the time being, let's just leave it as a in Mexico.

166
00:11:07,720 --> 00:11:09,820
Let's submit ours.

167
00:11:09,840 --> 00:11:17,250
We have job updated and we set back your different values and that if I take a look at all the jobs,

168
00:11:17,700 --> 00:11:19,440
not ours, it is front end.

169
00:11:19,950 --> 00:11:21,870
It is a full-time one.

170
00:11:21,990 --> 00:11:26,580
It is actually an interior because we change our value as well, and we're good to go.

171
00:11:26,850 --> 00:11:33,630
And if, for example, I decide that I'm also going to do the same thing with the back on one, maybe

172
00:11:33,630 --> 00:11:35,790
let me change the location.

173
00:11:36,180 --> 00:11:38,070
I'm going to go here with Brazil.

174
00:11:38,340 --> 00:11:42,150
If everything is correct, then we have job updated.

175
00:11:42,210 --> 00:11:43,830
We switch back to our jobs.

176
00:11:44,070 --> 00:11:48,990
Basically, we set it back to the default, and now this one is the Brazil one.

177
00:11:49,260 --> 00:11:50,670
And lastly, let me just mention.

178
00:11:51,780 --> 00:11:54,030
The reason why we didn't need important, I think.

179
00:11:54,870 --> 00:12:02,430
As far as the outer job is, because when we were setting it up as a placeholder, meaning when we just

180
00:12:02,430 --> 00:12:07,170
had the silly console.log, we already did that in the sonar.

181
00:12:07,560 --> 00:12:16,480
We already have the import 40 at a job in the AJAB and we also invoke it if we are editing.

182
00:12:16,830 --> 00:12:18,810
And that's why we didn't need to repeat anything.

183
00:12:19,230 --> 00:12:22,470
We were simply able to go to front them and test it out.

184
00:12:23,040 --> 00:12:30,570
And with this in place now, we have a complete delete and added job functionality in place.

