We have two more big steps to take care of inside of our form.
First off we need to make sure that we actually take the form values and post them off to our back end
API.
And we also have to make sure that after we do THAT POST request we also navigate our users back to
the dashboard route or the dashboard component.
Now before we tackle those two things there's one little issue I want to bring to your attention kind
of around the naming conventions that we've used inside of our applications so far.
So we've been putting together our front end form to create our survey.
And we have already gone to our back end express API in a previous video like way previous and we put
together the back end endpoint for accepting post requests to create a new survey.
Now there's a little bit of kind of dissonance between these two features that we've put together thus
far.
Here's the thing.
On the client side of our application Our form is currently producing an object so that form values
saying that we've been passing all over the place and it has a property named emails.
However on our backend when we previously put together together the API we had said that we expect to
receive a object that are a request that has a body property of recipients.
So we've got a real mismatch right now between the client side and what it's trying to post and the
back end and what it actually expects.
So we're going to do a little bit of kind of reconfiguration side this video.
We're going to rename this email's property on our client side to the recipients instead.
Now this is going to be a really easy a really straightforward factor.
So let's just get to it right now inside my code editor.
I'm going to find first the form fields file inside of our surveys directory and inside of there I'll
find the last property last object and rather than giving it a name of e-mails we'll change the name
to be recipients instead.
So now we're saying hey there's going to be a property in our form called recipients as always do double
check your spelling on recipients right here.
Now the only other place we have to change this is inside of our survey form component inside of survey
form down at the bottom the file we can find our validate function and validate is currently assuming
that we have an email property.
So rather than making use of emails we will instead say estopped recipients and it should be looking
at the value on the values object of recipients over there as well.
So as recipients and value recipients.
OK.
So that's pretty much it.
That's the only renaming we have to do to make sure that our back and in our client are producing the
same property names so that in mind let's take a quick break.
We'll come back in the next section and we're then going to create our post request to actually send
our e-mail or our form to our back end server.
So I'll see you in just a minute.