| Conditions | 1 |
| Paths | 1 |
| Total Lines | 8 |
| Lines | 0 |
| Ratio | 0 % |
| Changes | 1 | ||
| Bugs | 0 | Features | 0 |
| 1 | import callAPIMethod from './callAPIMethod'; |
||
| 8 | api[resourceId] = Object.keys(resources[resourceId].methods).reduce( (resource, method) => { |
||
| 9 | resource[method] = (params, methodOptions) => { |
||
| 10 | const apiParams = resources[resourceId].methods[method](params); |
||
| 11 | const bindedCallAPIMethod = callAPIMethod.bind(null, APIPrefix, fetchOptions, resources[resourceId].prefix); |
||
| 12 | return applyMiddleware(bindedCallAPIMethod, middleware, methodOptions, apiParams, resourceId, method); |
||
| 13 | }; |
||
| 14 | return resource; |
||
| 15 | }, {}); |
||
| 16 | return api; |
||
| 20 | export default createAPI; |