1
00:00:00,180 --> 00:00:00,460
All right.

2
00:00:00,480 --> 00:00:05,850
And before we start setting up the components that we're going to use to display all the jobs.

3
00:00:06,390 --> 00:00:08,820
Let's talk about the elephant in the room.

4
00:00:09,720 --> 00:00:16,680
I'm talking about the log out user, essentially why it is here, as well as the clear alert.

5
00:00:16,950 --> 00:00:18,510
And let's start with this one.

6
00:00:19,170 --> 00:00:27,090
And let's simply try to understand what kind of errors we possibly might get in the all jobs page.

7
00:00:27,330 --> 00:00:34,830
Unlike the ad job where possibly again, we have the checks on the front end, but possibly you could

8
00:00:34,830 --> 00:00:36,120
get one hundred.

9
00:00:36,540 --> 00:00:42,330
It's not going to be the case with all jobs, and it's not also going to be the case of four or four.

10
00:00:42,570 --> 00:00:43,620
I mean, it shouldn't.

11
00:00:44,070 --> 00:00:53,640
If we build everything correctly, there should be no 400 responses or four offers, even if the filters

12
00:00:54,000 --> 00:00:55,710
return pretty much nothing.

13
00:00:56,070 --> 00:01:02,220
So if I'm going to go here with some kind of gibberish or the worst case scenario, you'll get back

14
00:01:02,220 --> 00:01:02,810
empty your.

15
00:01:03,810 --> 00:01:08,010
And then we will display no jobs to display.

16
00:01:08,640 --> 00:01:10,230
So where I'm going with this.

17
00:01:10,890 --> 00:01:17,520
Possible errors are for a one that I would be on authenticator or 500.

18
00:01:17,940 --> 00:01:18,270
Correct.

19
00:01:18,780 --> 00:01:19,650
The server's down.

20
00:01:20,400 --> 00:01:29,460
So now let's try to understand, does it really make sense for us to go to actions and set up get jobs

21
00:01:29,460 --> 00:01:29,850
error?

22
00:01:30,150 --> 00:01:37,730
And if that is the case, then we display the on authenticated alert or here or we say that the servers

23
00:01:37,760 --> 00:01:38,010
them.

24
00:01:38,340 --> 00:01:40,950
I mean, just like a lot of things in this application.

25
00:01:41,280 --> 00:01:46,590
It is my personal opinion, but if I really hit that 401.

26
00:01:47,500 --> 00:01:53,950
Or we had that 500, then we just log out this year because there's something wrong with our application.

27
00:01:54,250 --> 00:02:00,850
And if we have the 400 or four or four and it's the same deal, we shouldn't be getting those errors

28
00:02:00,850 --> 00:02:02,590
coming back from the server.

29
00:02:03,010 --> 00:02:10,389
Now also, let's remember that when it comes to four or one, the unauthenticated we are already on

30
00:02:10,630 --> 00:02:13,150
over here, so that's taken care of.

31
00:02:13,510 --> 00:02:20,950
But then the rest of the errors, instead of going with some kind of alert, will simply go with log

32
00:02:20,950 --> 00:02:21,580
out user.

33
00:02:21,850 --> 00:02:24,550
Now one gotcha kind of is the fact that.

34
00:02:25,510 --> 00:02:31,030
When we're setting everything up, basically as we're building the project, it might get sometimes

35
00:02:31,030 --> 00:02:33,760
annoying because you might set up the wrong URL.

36
00:02:34,120 --> 00:02:36,820
You might, I don't know, get the four or four or whatever.

37
00:02:37,180 --> 00:02:40,840
And in that case, it's kind of hard to troubleshoot since you're being locked out.

38
00:02:41,140 --> 00:02:43,570
So for time being, I'll just comment them out.

39
00:02:43,810 --> 00:02:50,590
Now I also want to mention, though, that we will do that in other components as well, because the

40
00:02:50,590 --> 00:02:51,640
same goes for that.

41
00:02:52,550 --> 00:02:57,890
I mean, I'm not going to repeat the whole thing, but if you're getting four or four over here, then

42
00:02:57,890 --> 00:02:59,390
there's something wrong with your application.

43
00:02:59,750 --> 00:03:04,760
If you're getting five hundred again, the user shouldn't be in this page in the first place, then

44
00:03:05,030 --> 00:03:07,700
because I mean, there's something wrong with your server.

45
00:03:08,000 --> 00:03:09,890
So hopefully that is clear.

46
00:03:10,280 --> 00:03:15,590
And as far as this console log, I will leave it because again, we all come back to this sucker later.

47
00:03:16,040 --> 00:03:19,110
There's still quite a bit of functionality we need to add.

48
00:03:19,520 --> 00:03:27,110
And yes, in the future requests, again, we'll check what's happening if there is a possible error

49
00:03:27,110 --> 00:03:28,070
that we want to display.

50
00:03:28,310 --> 00:03:29,120
Yes, we'll do that.

51
00:03:29,420 --> 00:03:33,560
If not, then again, it is my preference to go with logout users.

52
00:03:33,560 --> 00:03:40,040
Just keep in mind that for all of them, I will comment them out because like I said, when you're developing,

53
00:03:40,040 --> 00:03:46,940
I noticed that it can get quite annoying where you just basically log yourself out and then it's kind

54
00:03:46,940 --> 00:03:47,990
of hard to troubleshoot.

55
00:03:48,230 --> 00:03:50,660
That's just something that I noticed when I was building.

56
00:03:51,170 --> 00:03:52,730
Now what about this guy?

57
00:03:53,060 --> 00:03:54,620
What about clear alert?

58
00:03:54,800 --> 00:03:58,640
Because at the moment, you can take a look at the reducer and you're going to be like, What are you

59
00:03:58,640 --> 00:03:59,540
talking about over here?

60
00:03:59,840 --> 00:04:03,650
I mean, we're not setting up the alert or anything like that.

61
00:04:03,660 --> 00:04:07,520
We actually hide the alert in our jobs begin.

62
00:04:07,610 --> 00:04:08,690
Why are we clearing?

63
00:04:09,920 --> 00:04:13,610
Remember that, first of all, when it comes to our alert.

64
00:04:14,530 --> 00:04:17,290
We have that delay, again, that was my preference.

65
00:04:17,890 --> 00:04:22,690
And then what I noticed initially here, I did have the alert marked.

66
00:04:23,170 --> 00:04:26,830
So instead of the spinner and this one, I was using the alert.

67
00:04:27,010 --> 00:04:33,490
And what I noticed that if you had a job here and since this one is sitting here for whatever those

68
00:04:33,490 --> 00:04:40,690
two, three seconds or whatever, if you're quickly go to jobs, then that alert still displays the

69
00:04:40,690 --> 00:04:45,250
whatever is the value, the new job created or whatever you went through.

70
00:04:45,850 --> 00:04:52,420
And that's why I added those checks when I said, Look, once I start fetching it right away, I'm going

71
00:04:52,420 --> 00:04:56,620
to hide it, meaning once we go eventually to that page, we'll right away hide it.

72
00:04:56,770 --> 00:05:02,980
And the same goes over here where it's just my precaution when I say, Look, if there is any alerts,

73
00:05:03,310 --> 00:05:04,210
let's just hide it.

74
00:05:04,690 --> 00:05:09,370
Technically, you can remove them both and everything is going to be fine because I can tell you that

75
00:05:09,820 --> 00:05:12,370
there will be no alert over here.

76
00:05:12,610 --> 00:05:18,460
Again, I was just when I was initially testing, but I do want to mention that if you will set up some

77
00:05:18,460 --> 00:05:25,010
kind of alert system over here, then remember, since these ones are persistent for a little bit longer.

78
00:05:25,030 --> 00:05:28,030
Again, those two three seconds, that little bit of delay.

79
00:05:28,420 --> 00:05:34,240
That's why they will be displayed also in a different pages if you quickly navigate.

80
00:05:34,600 --> 00:05:36,390
Again, it's not going to be our scenario.

81
00:05:36,400 --> 00:05:37,020
We're not going to do.

82
00:05:37,300 --> 00:05:44,980
But that's why I added the clear alert as well as in the reducer, the show alert false.

83
00:05:45,820 --> 00:05:52,810
So long story short, when it comes to the errors, in my opinion, it's better in this case to log

84
00:05:52,810 --> 00:05:57,770
out the user if we're hitting any of the errors because it doesn't make sense.

85
00:05:57,790 --> 00:06:00,010
We shouldn't be getting those errors in the first place.

86
00:06:00,400 --> 00:06:06,790
It's not like with empty values in the Anjam, and when it comes to clearing alert, this is just a

87
00:06:06,790 --> 00:06:07,400
precaution.

88
00:06:07,780 --> 00:06:15,670
If you do have eventually the alert component in the all jobs page or stats page, which in our case,

89
00:06:15,670 --> 00:06:16,330
we won't.

90
00:06:16,450 --> 00:06:20,050
So technically, if you don't want to use them, you can just.

