1
00:00:00,780 --> 00:00:06,220
And once we can create the job now, of course, let's worry about the rest of the functionality and

2
00:00:06,240 --> 00:00:07,310
let's do it one by one.

3
00:00:07,620 --> 00:00:13,440
So next one up, we have got all jobs now in order to get the jobs.

4
00:00:13,440 --> 00:00:18,230
We are already know the method that I find, which is, of course, available on the model.

5
00:00:18,300 --> 00:00:24,210
However, in this case, when it comes to the filter object, of course, will pass and created by property

6
00:00:24,570 --> 00:00:32,970
and will set it equal to the user, because what we want is to get only the jobs that are associated

7
00:00:33,150 --> 00:00:34,040
with the user.

8
00:00:34,260 --> 00:00:38,040
And I know that I keep pretty much repeating the same thing and my apologies for that.

9
00:00:38,310 --> 00:00:41,330
But that is very, very crucial in this case.

10
00:00:41,370 --> 00:00:45,180
We're not looking for all the jobs like we did in a task.

11
00:00:45,180 --> 00:00:50,300
We're only looking for the jobs that are associated with this user.

12
00:00:50,760 --> 00:00:56,640
And as far as the functionality goes, something like this where we'll go with jobs, that is equal

13
00:00:56,640 --> 00:01:02,610
to await and then I'll go at job find and remember to filter object.

14
00:01:02,820 --> 00:01:07,350
And remember, if it was empty, then of course we're just getting all the jobs.

15
00:01:07,350 --> 00:01:09,560
But that's not what we want in here.

16
00:01:09,570 --> 00:01:17,130
We want to say created by and we want to set it equal to Iraq user and user ID.

17
00:01:17,250 --> 00:01:26,130
Again, that user property here is going to be on every request since in the Objets we placed our off

18
00:01:26,130 --> 00:01:30,090
middleware in front of all of our jobs are out.

19
00:01:30,330 --> 00:01:37,760
And then let's also sort quickly and let's sort of based on creative that remember this property of

20
00:01:37,800 --> 00:01:40,830
the creator, that much sort of based on that.

21
00:01:41,340 --> 00:01:47,210
So let's say here that sort of lets just pass in the property created that.

22
00:01:47,640 --> 00:01:51,770
And as far as the response, well, let's just go with that status.

23
00:01:52,260 --> 00:01:59,460
And as far as the status codes, of course, we be looking for OK, one STR status codes and then OK.

24
00:01:59,670 --> 00:02:07,230
And when it comes to just one response, I want to send back the jobs as well as the count because that's

25
00:02:07,230 --> 00:02:09,600
what I'm looking for on my front.

26
00:02:09,600 --> 00:02:13,830
And again, this is a really optional you can of course send just jumps.

27
00:02:14,130 --> 00:02:16,740
But in my case I want to send both.

28
00:02:16,920 --> 00:02:22,080
And once I have all of this in place now of course we can go back to the postman.

29
00:02:22,440 --> 00:02:27,030
I'll save both throughout the register user as well as great job.

30
00:02:27,330 --> 00:02:34,770
And, you know, why don't we create a few more jobs soon here and say Apple and we'll say front end

31
00:02:34,770 --> 00:02:35,400
developer.

32
00:02:37,150 --> 00:02:44,500
Developer and then let's create one more, and this one will be Facebook, and as far as the developer,

33
00:02:44,530 --> 00:02:46,170
let's just say back on one.

34
00:02:46,600 --> 00:02:48,030
So let's send it here.

35
00:02:48,430 --> 00:02:51,880
And once I send I want to check my database in there.

36
00:02:51,880 --> 00:02:52,920
I have jobs.

37
00:02:52,940 --> 00:02:53,820
Okay, that's good.

38
00:02:54,220 --> 00:02:57,880
And as far as I know, I believe I'm setting up everything.

39
00:02:57,880 --> 00:03:03,990
Asthana I have the one for Google, one for Apple, as well as the Facebook.

40
00:03:04,240 --> 00:03:08,490
And once I have all of these jobs in place now, of course, we can create a new route.

41
00:03:08,740 --> 00:03:15,540
So let me serve it over here and let's just go with in this case, of course, and we're looking for

42
00:03:15,550 --> 00:03:16,390
your URL.

43
00:03:16,690 --> 00:03:20,380
And this is going to go to the same one as create job.

44
00:03:20,680 --> 00:03:26,470
So we simply go forward slash and jobs and of course, we just send it.

45
00:03:26,650 --> 00:03:31,550
And if everything is correct, we should get authentication involved.

46
00:03:31,570 --> 00:03:31,900
Why?

47
00:03:31,900 --> 00:03:34,380
Because, of course, we do need to include data.

48
00:03:34,660 --> 00:03:36,400
So let me go back to the headers.

49
00:03:37,310 --> 00:03:43,340
Let's go to authorisations and of course, we know that our military works, we cannot just randomly

50
00:03:43,340 --> 00:03:45,230
access all the jobs.

51
00:03:45,360 --> 00:03:47,390
You can only access your jobs.

52
00:03:47,660 --> 00:03:53,940
And then let's go with Barer and then let's pass in the token that we have for Anna.

53
00:03:54,380 --> 00:03:56,540
Again, I'll show you in a second.

54
00:03:57,080 --> 00:04:02,030
We can set this up programmatically so we don't have to copy and paste every time.

55
00:04:02,500 --> 00:04:06,820
So let's say here, barer, let's send and now, of course, I have jobs.

56
00:04:06,830 --> 00:04:13,490
Agree with the count of three and I can clearly see that all the info is correct.

