redux-supermodel
Advanced tools
Comparing version 0.11.0 to 0.12.0
@@ -59,3 +59,4 @@ 'use strict'; | ||
var idAttribute = definition.idAttribute, | ||
var _definition$idAttribu = definition.idAttribute, | ||
idAttribute = _definition$idAttribu === undefined ? 'id' : _definition$idAttribu, | ||
url = definition.url, | ||
@@ -78,2 +79,3 @@ urlRoot = definition.urlRoot, | ||
var idUsed = false; | ||
function getResourceUrl() { | ||
@@ -84,3 +86,3 @@ var data = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {}; | ||
var _part = typeof urlRoot === 'function' && urlRoot.call(definition, { data: data, method: method }) || urlRoot; | ||
var id = data[idAttribute || 'id']; | ||
var id = data[idAttribute]; | ||
@@ -91,2 +93,3 @@ if (!id) { | ||
idUsed = true; | ||
return urlAppend(baseUrl, _part, encodeURIComponent(id)); | ||
@@ -103,2 +106,8 @@ } | ||
var data = inputData; | ||
if (idUsed) { | ||
data = _extends({}, data); | ||
delete data[idAttribute]; | ||
} | ||
if (rootParam === true || typeof rootParam === 'string') { | ||
@@ -109,3 +118,7 @@ var rootLabel = rootParam === true ? resourceName : rootParam; | ||
var config = _extends({}, rest, { url: requestUrl, method: method, data: data }); | ||
var config = _extends({}, rest, _defineProperty({ | ||
url: requestUrl, | ||
method: method | ||
}, method === 'get' ? 'params' : 'data', data)); | ||
if (before) { | ||
@@ -112,0 +125,0 @@ config = before(config) || config; |
{ | ||
"name": "redux-supermodel", | ||
"version": "0.11.0", | ||
"version": "0.12.0", | ||
"description": "A package of action creator functions and reducers that deal with the state management of REST-like APIs for you... all you need is a URL!", | ||
@@ -24,33 +24,33 @@ "repository": "https://github.com/MrLeebo/redux-supermodel", | ||
"devDependencies": { | ||
"babel-cli": "^6.18.0", | ||
"babel-cli": "^6.23.0", | ||
"babel-eslint": "^7.1.1", | ||
"babel-plugin-transform-async-to-generator": "^6.16.0", | ||
"babel-plugin-transform-object-rest-spread": "^6.20.2", | ||
"babel-plugin-transform-async-to-generator": "^6.22.0", | ||
"babel-plugin-transform-object-rest-spread": "^6.23.0", | ||
"babel-plugin-transform-regenerator": "^6.22.0", | ||
"babel-polyfill": "^6.23.0", | ||
"babel-preset-es2015": "^6.22.0", | ||
"babel-preset-react": "^6.16.0", | ||
"babel-preset-react": "^6.23.0", | ||
"babel-preset-stage-0": "^6.22.0", | ||
"babel-register": "^6.18.0", | ||
"bdd-lazy-var": "^1.2.0", | ||
"body-parser": "^1.16.0", | ||
"enzyme": "^2.7.0", | ||
"eslint": "^3.13.1", | ||
"eslint-config-standard": "^6.2.1", | ||
"babel-register": "^6.23.0", | ||
"bdd-lazy-var": "^1.2.1", | ||
"body-parser": "^1.17.1", | ||
"enzyme": "^2.7.1", | ||
"eslint": "^3.17.1", | ||
"eslint-config-standard": "^7.0.1", | ||
"eslint-plugin-import": "^2.2.0", | ||
"eslint-plugin-promise": "^3.4.0", | ||
"eslint-plugin-react": "^6.9.0", | ||
"eslint-plugin-standard": "^2.0.1", | ||
"express": "^4.14.0", | ||
"jsdom": "^9.9.1", | ||
"eslint-plugin-promise": "^3.5.0", | ||
"eslint-plugin-react": "^6.10.0", | ||
"eslint-plugin-standard": "^2.1.1", | ||
"express": "^4.15.2", | ||
"jsdom": "^9.11.0", | ||
"mocha": "^3.2.0", | ||
"mock-require": "^2.0.1", | ||
"nyc": "^10.0.0", | ||
"nyc": "^10.1.2", | ||
"react": "^15.4.2", | ||
"react-addons-test-utils": "^15.4.2", | ||
"react-dom": "^15.4.2", | ||
"react-redux": "^5.0.2", | ||
"react-redux": "^5.0.3", | ||
"redux": "^3.6.0", | ||
"redux-promise-middleware": "^4.2.0", | ||
"sinon": "^1.17.7" | ||
"sinon": "^2.0.0" | ||
}, | ||
@@ -57,0 +57,0 @@ "dependencies": { |
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
27796
421