wappsto-redux
Advanced tools
Comparing version 3.0.5 to 3.0.6
@@ -78,3 +78,3 @@ import querystring from 'querystring'; | ||
function requestSuccess(id, method, url, responseStatus, json, options){ | ||
function requestSuccess(id, method, url, body, responseStatus, json, options){ | ||
return { | ||
@@ -85,2 +85,3 @@ type: REQUEST_SUCCESS, | ||
url, | ||
body, | ||
responseStatus, | ||
@@ -92,3 +93,3 @@ json, | ||
function requestError(id, method, url, responseStatus, json, options){ | ||
function requestError(id, method, url, body, responseStatus, json, options){ | ||
return { | ||
@@ -99,2 +100,3 @@ type: REQUEST_ERROR, | ||
url, | ||
body, | ||
responseStatus, | ||
@@ -118,2 +120,5 @@ json, | ||
dispatch(removeEntities(service, json.deleted, { ...options, parent, reset: false })); | ||
if(json.shared_deleted){ | ||
dispatch(removeEntities(service, json.shared_deleted, { ...options, parent, reset: false })); | ||
} | ||
break; | ||
@@ -170,3 +175,3 @@ default: | ||
dispatchMethodAction(dispatch, requestOptions.method, url, response.json, options); | ||
dispatch(requestSuccess(id, requestOptions.method, url, response.status, response.json, options)); | ||
dispatch(requestSuccess(id, requestOptions.method, url, data, response.status, response.json, options)); | ||
} else { | ||
@@ -176,3 +181,3 @@ if(response.json && response.json.code === 9900025){ | ||
} | ||
dispatch(requestError(id, requestOptions.method, url, response.status, response.json, options)); | ||
dispatch(requestError(id, requestOptions.method, url, data, response.status, response.json, options)); | ||
} | ||
@@ -179,0 +184,0 @@ } |
{ | ||
"name": "wappsto-redux", | ||
"version": "3.0.5", | ||
"version": "3.0.6", | ||
"description": "", | ||
@@ -5,0 +5,0 @@ "main": "index.js", |
@@ -31,3 +31,3 @@ import { normalize } from 'normalizr'; | ||
function removeEntities(state, type, ids){ | ||
function removeEntities(state, type, ids = []){ | ||
ids.forEach(id => { | ||
@@ -81,3 +81,3 @@ let newData = removeEntity(state, type, id); | ||
if(childDef){ | ||
newData = removeEntities(state, child, ids || element[child]); | ||
newData = removeEntities(state, child, ids || element[child] || []); | ||
state = newData.state; | ||
@@ -84,0 +84,0 @@ if(childDef.type === "many"){ |
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
49848
1232