@@ -96,24 +96,20 @@ Lets create our handler now (e.g we using axios to take care of this for us):
96
96
// file: ~/api_handler
97
97
import axios from ' axios' ;
98
98
99
- export default () {
100
-
101
- // path is the relative path of the route
102
- // verb is the method type
103
- // {query, body, params} are the given payload to send
104
- // {prefix} are api options (prefix is the api prefix, e.g: '/api')
105
- export default (path , verb , {query, body}, {prefix}) => {
106
- return axios ({
107
- baseURL: ` http://${ process .env .HOST } :${ process .env .PORT }${ prefix || ' ' } ` ,
108
- timeout: 10000 ,
109
- url: path,
110
- method: verb .toLowerCase (),
111
- data: body,
112
- params: query
113
- }).then (({data}) => data);
114
- };
115
-
116
- }
99
+ // path is the relative path of the route
100
+ // verb is the method type
101
+ // {query, body, params} are the given payload to send
102
+ // {prefix} are api options (prefix is the api prefix, e.g: '/api')
103
+ export default (path , verb , {query, body}, {prefix}) => {
104
+ return axios ({
105
+ baseURL: ` http://${ process .env .HOST } :${ process .env .PORT }${ prefix || ' ' } ` ,
106
+ timeout: 10000 ,
107
+ url: path,
108
+ method: verb .toLowerCase (),
109
+ data: body,
110
+ params: query
111
+ }).then (({data}) => data);
112
+ };
117
113
```
118
114
119
115
** NOTE** : You must return exactly what the controller action + ``` successHandler ``` return,
0 commit comments