Handle form submit
At this moment, our registration form is ready to receive input and handle the submit. We can move forward to implement the logic of sending data the backend, which starts from the submitForm() method. Inside this method, we could use the HTTP client, axios, directly to do the heavy lifting, as we already introduced in Chapter 3, Spring 5 - The Right Stack for the Job at Hand. This time, we will use it differently. We will create a service called registrationService in the frontend/src/services/registration/index.js file to wrap the details of how to send HTTP requests using axios. The benefit of doing this is that we hide the implementation of the communication with the server from RegisterPage.vue so that, once we need ...
Become an O’Reilly member and get unlimited access to this title plus top books and audiobooks from O’Reilly and nearly 200 top publishers, thousands of courses curated by job role, 150+ live events each month,
and much more.
Read now
Unlock full access