August 2017
Beginner
298 pages
7h 4m
English
We will use a POST API call to register our users. However, in the status section of the app, we need to use a GET request to show the statistic data of the people interested in the event. So, we are going to build a generic API call module.
To create the API call module, inside the services directory, create another directory called api and, inside it, create apiCall.js. The structure of your services directory should be as follows:
.├── api│ └── apiCall.js└── formValidation └── validateRegistrationForm.js
Inside apiCall.js file, create the following function:
export default function apiCall(route, body = {}, method='GET') {}
In the preceding function, route is a required parameter, while body and method have ...
Read now
Unlock full access