Nice work, we have the default values for two jobs in the state, so now set up the get all jobs request
on the front and.
Like always, we want to start in the actions, so there's going to be to our actions, get jobs, begin
and get job success.
And I'll spend the next video covering, why don't we have the IRA?
Because this is a very, very important part of the application.
Then once we have the actions there, import, export and all that and then we want to set up get jobs
function.
And here you'll notice this URL.
Now, why am I structuring it in this way?
Well, because again, there are going to be more functionality once we set up the filtering.
For now, we should just remember that yes, we have API version one.
But since we have auth, which we already have the best URL and since the path to get all the jobs is
for large jobs.
So that's the root path.
I'm simply going to pass the jobs, and yes, I have here purposely template strings because again,
we'll be accessing the state voters.
We'll be doing some calculations and all that stuff.
But all of that is coming up.
We have to get jobs begin, and at this point, you probably already know that we will be setting up
the loading over there.
Then we're looking for the data coming back from off, of course, await.
And then we pull out jobs, total jobs, a number of projects coming from where?
From the data.
And if you need to double check, you can just go back to the postman.
As far as this batch, we're going to get jobs successful and then we have jobs, total jobs and number
of pages.
Now I already included the log out user, so I'm kind of geared our way what we're going to do.
But for the time being, we'll just log the error and I'm going to talk about this clear alert in next
video as well.
Now, how are you going to update the state of ours?
Well, we're going to go over here with reducer and get jobs begin, which is going to have ease.
Loading True.
And Charlotte, in this case, false.
And again, when I talk about the alerts in next video as well and get job success, what we set is
loading to false.
So we're not going to be loading because there is going to be a loading spinner.
Now, if I go to complete application, we have that loading screen our first, second and once we're
done loading.
Then of course, I had it.
And what are we getting back in the payload?
While we have jobs, total jobs and number of pages, we set those values in state and we're good to
go.
So let me just navigate to the actions first, I guess, and let's create those two.
So I think I'm going to just copy and paste this one and then let's just change these flowers around.
We're not going to be create job.
It's going to be getting jobs and it's not going to be an hour either, since we're not going to use
that.
So with me right now, select all four of them.
Remove and let's just go here with get on the score jobs and then back then.
And yes, I probably should have left those customers, but it is what it is.
So make up in post.
I think I've been patient over here as well and now set up Matthew cursors, and we're just going to
be dealing with success once I have these two actions.
Then we want to go to have context as well as the reducer.
So yeah, let's go, get jobs begin, get jump success and the same deal in the reducer.
Let's not forget there.
We're looking for the imports coming from the actions.
And let's just add those two suckers.
Then let's keep on scrolling and some more at the end, I guess right after the final change or not
the great job, I guess.
Now I want to set up my functionality to get on the job.
So he's no, it can't get jobs.
Now that is equal to and I think when we have the function and here, like I said, we're going to go
with llut and non-euro because we will modify this value.
Essentially, we'll be adding the query, string parameters and all that stuff.
So it just go here with jobs and then onto this project first, the big in one go type and then get
jobs.
And we're not looking for success.
We want to go with again.
Then let's go with try and catch an inside of the try catch block.
Let's pull out the data right away.
We already know where is it sitting?
Then let's go with a weight of an offset to remember the base URL API version one, and then we'll pass
in the URL.
So since we're not passing any data here and simply provide the URL, then we're going to go with Konst
Jobs, total jobs and number of pages.
And as a sign out by default, it is get.
So if you want, you can write this word as well, but I'm just going to go with Orthotouch just as
a sign up.
That's pretty much a ActionScript.
So cost and then jobs, how much total jobs?
And I also want to go with a number of pages.
All of that is sitting where you're just sitting in the data, and now we want to dispatch that.
We're going to go with this.
And then here we're going to go to type, get an underscore jobs and we're looking for success one.
That's number one.
And then also, we want to go to payload.
And here we're going to go with jobs.
Total jobs and all certain number of pages like so let's say that one.
And then inside of the courtroom, like I said for time being one, just go and log and we're going
to be looking for counsel or I'm sorry.
We're going to go with our human response.
Let's say that let's just add that clear alert, which we're going to discuss in next video.
Now let's go to a producer and actually handle that.
And the first thing that we want to do is set up the loading.
And, yes, alert equal to false, even though maybe at the moment, it doesn't make sense, so let's
go over here with action.
That type is equal to get and then underscore the jobs back then.
And here we want to go with return that not and that state and then we want to start loading is true.
So that is going to trigger a VAT spinner.
And second will have a shoulder.
And as a quick hint, when it comes to these shorts.
This is pretty much a precaution.
Technically, can actually augment that.
And again, I will discuss that in next video.
So action on type and now it's only this one.
So get job and we're looking for a successful one.
And here it's pretty straightforward.
There's really no alert.
So it might as well just go with a turn.
Then we're looking for a state together, not an island state.
And as far as the values, well, that's set up is loading.
It goes to false heaven.
We want to go with jobs and then no one will be equal to action that payload, that jobs.
Let's save it for now.
And me actually set it up in New York because I think it's going to be easier for you to follow.
And I'm just going to jump in first and then we want to just provide different powers.
So instead of jobs, we'll go with total jobs.
And then here instead of jobs, we're going to go ahead and come off and graduate and once we have the
reduced functionality in place.
Now let's quickly swing back to the app context and actually invoke the good jobs.
Now, why do we want to do it here, because like I said, we don't have the actual component which
is going to trigger that federal question.
So it might as well just start out over here where I want to go with use.
And I'm looking for years of fact, right?
And we want to keep on scrolling online somewhere here in the bottom.
We're just going to go with use of fact and inside of the callback function.
We're just going to go get jobs.
We own rocket.
And let's just set it up on initial render.
Again, this is just temporary.
Effectively, we will remove it at the end of this video.
Once navigate back to a project we can refresh.
And what you'll notice in the state is that instead of those default values, now we have jobs, essentially,
which is an array of R&D model jobs, which is going to be three.
And then you can read the rest where I have number of pages and we didn't change the breadcrumbs, so
that one stays the same.
And with this in place, like I said, just go back, we can see that everything works and we can remove
this one.
I think I'm going to get that annoying warning.
So I'm also going to remove the import and we're good to go now.
We can start creating our components.