Now, before we continue, I just noticed that have actually a doozy.
Well, you know, I'm not checking for is loading in the Ajob.
Before we do anything, why don't we do that?
Let me go to add jump.
And then around here, I have my submit button and all that.
So why don't we do this?
Why don't we go with is the loading which we want to check from the state, actually?
So I don't know why I'm grabbing this over here.
I want to go first with is loading.
And if it's the case, I want to disable again that button.
So let's set up here disabled and I is going to be equal to you is voting, which essentially just prevents
user from submitting the form while we're still in the middle of the request.
And now let's set up the entire functionality where first we'll start in actions.
And then I guess I'll copy this one so onetime copy.
Then let's select both of them.
Let's move.
We're going to go with create and then a job and back then.
And now, of course, we're going to copy and paste and set this one up as success.
So once we're successful and also we have one for error, let's set this one up, right?
I mean, I don't need to already tell you what we're going to do in the app context.
Where do need to start with import?
So let's go here would create jobs again, create job success and create jobs.
Right away, set them up in the reducer just so I don't get some doozies along the way.
So that's going to be over here in Paris.
OK, awesome.
And not in the context.
What set up our create job again?
We pretty much have everything in place already.
We have the auth fetch, which probably is the most important one.
And then we just need to remember, well, what is the path and what actually we are expecting as far
as the back end.
So let me go over here with Konst and I'm going to set up create job now that is equal to and a sync
function.
We're not going to pass anything in.
Again, we're getting the values from the state, so it doesn't really matter.
The dispatch is over here and we want to go with type.
And that one will be create job and not error.
Some reason it's not giving me suggestions that I'm actually looking for.
That's the first thing we want to dispatch event, try and catch since we'll have our access requests
or accounts.
And now let's pull out $5 from the state.
So now I'm looking for what I'm looking for, this guy over here with me grow up.
And I know that in the state, I will have all those values.
So that's what I want to access.
So me navigate back and I'll sort of equal to the state.
That's why I'm getting it from.
And let's just look for a position in this case.
We also want to look for a company the job, location, correct location and also job type status.
And you know what?
There's another doozy in my read me.
Actually, we're not looking for a token.
So it's probably testing something.
And therefore, I got it from the state.
We actually don't need it.
So let's go back to the Arab context.
Grab all of these things and then remember, what is the URL?
Well, it is API version one and then forward slash jobs.
So let me double check.
So there are no doozies in here.
Let's say that I'm looking for what the approach and job reports.
OK, so that's going to be the root.
OK.
I create the job.
And then if I take a look at the server, you have API version one and then the jobs down here will
authenticate the user.
So again, this is going to be the case where we might get Baghdad for one, and that's the case of
and we want to kick out the user from the application.
So let's start.
I'm going to go with 08 again.
We're not looking for any kind of response because we're going to display jobs with a separate request
anyway.
And then we want to go with off fetch since we have right away a base URL whenever we want to go with
for its lush.
And remember, we also have those interceptors that add that token right from the get go.
And then what do I want to pass in all these properties like?
So those are going to be with my request.
So let me copy and paste.
And then if everything is correct, we want to dispatch two things.
We want this batch first.
The type of create job and success.
That's number one.
And second, if we're successful, what are we gonna do?
We're to clear out the values in order to have this batch for that correct.
Now, if you want, you can set up like I show here, the function clear hours from my kitchen.
I'm going to go with dispatch.
Don't ask me why.
We're just going to say here dispatch and we want to set it equal to our clear values.
One.
Now, when it comes to error, again, I don't want that alert hanging there for those three seconds.
So first, let's just go with if I'm not error.
That and our response.
I'm status.
Essentially, this is another way Howard can ride that if it is equal to for one, then we don't want
this pressure that to lurk altogether or simply want to return from here.
Now, if that is not the case, then we go with this patch and then Typekit is equal to create jobs
and God is giving me not what I'm looking for.
I want the arrow on.
And then as far as the payload, remember, it's always going to be anywhere in that message.
So I'm going to set up my message properly, and that will be equal to error dot.
Then a response dot data and dot and then the message one.
Let's save this one, and let's go to a job one, so I'm looking for my ad job component I already have
disabled set equal to is loading now and you're not actually been past the function.
See how easy it is to make a mistake not to go here with create job.
Pass it down.
And then in the ad job, we should have ActionScript.
So let's say here, create an job.
Once I save it in the handle, submit not only I want to check for these rules and as an official comment
amount, just so we can test out the errors.
And then let's also check what is editing, which eventually we will invoke.
So editing, which again, a nice is before a thousand times is false right now.
And by default, it's always going to be full.
That's the case.
We return.
Let me add the common just so I don't forget.
Meaning, I mean, I'll definitely won't forget adding at a job, but just so we're all on the same
page.
Eventually, hopefully, I spelled it correctly and we're going to go at it job and we'll invoke it
now where I have the log, though.
I want a moment and we're going to go create job, so let's save this one and let's test it out where
I want to go here.
And you know what?
I will start with error.
Let's try it out, whether we're getting back proper error from the server.
So let's go here and we right away have create a job begin.
And apparently it is an issue.
And you know what?
Yeah.
I mean, what was I thinking?
I mean, I didn't set up the producer.
Correct?
Tough guy.
OK, so let's go here to the producer and let's figure out what we're looking for.
That's the thing.
When you set up the read me in one way, then I mean, you also coded that way as well.
So this is going to be the case where essentially we want to set up the loading when we begin.
So miss, crawl over here and I'm going to go with if an action that type now I'm looking for create
job and not error.
Let's go with begin first.
And here we go with return.
That and not state.
And now let's look for is loading and insert equal to true.
That's when we are making that request.
And you know what?
Let's go where we have the, I don't know, set up user error.
Let's take this one, and let's just change around some hours here.
I think that's going to be a little bit better.
So copy and paste, I'm not looking for create user and actually error as well.
I want to go would create job and then success.
And here we don't have much like I said, we just want to set up is loading files.
We want to show the alert.
It's not going to be danger, actually going to be success or here.
And as far as the message, well, what does this play a new job creator really up to you new job and
then create it?
That's the message.
Save this one and I'll take this one.
Copy and paste, and let's set it equal to error.
And as far as this goes, yes, gloating is still false, that still says the same solar, true?
Yep.
But we're going to go with danger and this is the case where we will pass in that action payload message
through action, payload and message.
So now let's see whether everything works.
I mean, should.
So now let's again tested out with an IRA.
And yet I have 400, which is awesome.
Have the 400 response.
Please provide all of ours.
OK, that's good.
Now one thing I'm noticing, though, that it's not going away.
And now what's the reason for that?
Well, because in here we also need to go after trying to catch and actually clear the alert, correct.
So we'll go here with clear and alert like, so let's invoke it.
Now, let's try one more time.
I'm going to submit.
We get back.
Please provide all of ours.
Now this is coming from the server since we commented it out on our end.
And then let's try to create that job.
So I'm going to go over here with let's do the something again, something.
And let's copy and paste.
It's not going to be Mexico.
I'm going to go with something.
Let's submit we have new job created.
And now let me go and take a look at my database.
And once I navigate to my Atlas account, what do you know?
Not only I have the job that we created with the postman.
I also have the one that we just created with a frontend.
And this concludes our job for now until we set up at a job functionality.
But before we switch back to the server and start setting up the good jobs functionality in there,
I actually want to go to the AJAB and just make sure that this functionality works.
So I still want to check for these empty values here on the frontend.
And with this in place now, I can start worrying about getting all the jobs back from the server.