apis-builder
Advanced tools
Comparing version 1.2.0 to 1.3.0
19
index.js
@@ -29,3 +29,5 @@ const _ = require('lodash') | ||
function impl (data) { | ||
function impl (data, requestOptions) { | ||
if (_.isEmpty(requestOptions)) requestOptions = {} | ||
if (!_.isObject(requestOptions)) requestOptions = {} | ||
let requestPath = action.href | ||
@@ -54,3 +56,16 @@ const pathParams = action.href.match(/{[^}]+}/g) || [] | ||
} | ||
return this.client[action.method.toLowerCase()](requestPath, data) | ||
switch (action.method.toLowerCase()) { | ||
case 'get': | ||
case 'del': | ||
case 'delete': | ||
requestOptions.qs = data | ||
break | ||
case 'post': | ||
case 'put': | ||
requestOptions.body = data | ||
break | ||
} | ||
return this.client[action.method.toLowerCase()](requestPath, requestOptions) | ||
} | ||
@@ -57,0 +72,0 @@ |
{ | ||
"name": "apis-builder", | ||
"version": "1.2.0", | ||
"version": "1.3.0", | ||
"description": "", | ||
@@ -5,0 +5,0 @@ "main": "index.js", |
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
24248
190