All right.
And up next, let's set up create user functionality, which is going to be extremely similar to create
job.
Of course, in this case, we're going to work with the user model.
So first let's navigate to auth controller.
We're looking for to imports.
We want to grab the status codes since we're going to use them and also we want to grab the user.
So let's go here and we're looking for models and the user model.
Just make sure you add the JS.
Then let's look for register.
So this is where we are going to create the user and we're going to start by creating the variable.
I'm going to call this user.
This is going to be equal to a weight.
We're looking for user dot.
Then the method name is create.
And essentially we want to pass in req dot body.
And yes, of course there's going to be a validation layer.
That's why I'm just passing here.
Req.body since by the time the Req.body reaches the register, I already know that all the values are
going to be correct.
And then as far as the responses, first of all, let's go with status.
Let's set up the status codes and we're looking for created.
So this will be 201 then Json and we want to show the user with this in place.
Now let's navigate to read me.
And basically in order to speed this up, I just provided the Json you want to send.
So name, email, password and rest of the cool stuff.
So first let's copy this.
Let's navigate back again.
We're looking for register user for the body.
Let's send and check it out.
This is my user and all of the values and of course role by default is user and therefore I see it over
here and also the very, very bottom.
I have the ID as well.
So this is the functionality to create our user in the database.