@jfront/core-redux-saga
Advanced tools
Comparing version 0.4.0 to 0.4.1
@@ -6,2 +6,13 @@ # Change Log | ||
## [0.4.1](https://github.com/Jepria/jfront-core/compare/@jfront/core-redux-saga@0.4.0...@jfront/core-redux-saga@0.4.1) (2021-04-01) | ||
### Bug Fixes | ||
* null and undefined query params were added to query string ([6cbc5f4](https://github.com/Jepria/jfront-core/commit/6cbc5f454b8cf08ef16be2d925572509d9ab2c15)) | ||
# [0.4.0](https://github.com/Jepria/jfront-core/compare/@jfront/core-redux-saga@0.3.0...@jfront/core-redux-saga@0.4.0) (2021-03-22) | ||
@@ -8,0 +19,0 @@ |
@@ -78,3 +78,3 @@ "use strict"; | ||
function search(action) { | ||
var _action$payload$searc, query, result; | ||
var _action$payload$searc, template, param, query, result; | ||
@@ -86,3 +86,11 @@ return regeneratorRuntime.wrap(function search$(_context2) { | ||
_context2.prev = 0; | ||
query = new URLSearchParams(_extends({}, action.payload.searchTemplate.template, { | ||
template = _extends({}, action.payload.searchTemplate.template); | ||
for (param in template) { | ||
if (template[param] === undefined || template[param] === null) { | ||
delete template[param]; | ||
} | ||
} | ||
query = new URLSearchParams(_extends({}, template, { | ||
page: String(action.payload.pageNumber), | ||
@@ -94,20 +102,20 @@ pageSize: String(action.payload.pageSize) | ||
}); | ||
_context2.next = 5; | ||
_context2.next = 7; | ||
return (0, _effects.call)(api.search, query.toString()); | ||
case 5: | ||
case 7: | ||
result = _context2.sent; | ||
_context2.next = 8; | ||
_context2.next = 10; | ||
return (0, _effects.put)(actions.searchSuccess({ | ||
records: result.data, | ||
records: result.resultSetSize > 0 ? result.data : [], | ||
resultSetSize: result.resultsetSize | ||
})); | ||
case 8: | ||
case 10: | ||
if (!action.payload.onSuccess) { | ||
_context2.next = 11; | ||
_context2.next = 13; | ||
break; | ||
} | ||
_context2.next = 11; | ||
_context2.next = 13; | ||
return (0, _effects.call)(action.payload.onSuccess, { | ||
@@ -118,10 +126,10 @@ records: result.data, | ||
case 11: | ||
_context2.next = 20; | ||
case 13: | ||
_context2.next = 22; | ||
break; | ||
case 13: | ||
_context2.prev = 13; | ||
case 15: | ||
_context2.prev = 15; | ||
_context2.t0 = _context2["catch"](0); | ||
_context2.next = 17; | ||
_context2.next = 19; | ||
return (0, _effects.put)(actions.failure({ | ||
@@ -131,12 +139,12 @@ error: _context2.t0 | ||
case 17: | ||
case 19: | ||
if (!action.payload.onFailure) { | ||
_context2.next = 20; | ||
_context2.next = 22; | ||
break; | ||
} | ||
_context2.next = 20; | ||
_context2.next = 22; | ||
return (0, _effects.call)(action.payload.onFailure, _context2.t0); | ||
case 20: | ||
case 22: | ||
case "end": | ||
@@ -146,3 +154,3 @@ return _context2.stop(); | ||
} | ||
}, _marked2, null, [[0, 13]]); | ||
}, _marked2, null, [[0, 15]]); | ||
} | ||
@@ -149,0 +157,0 @@ |
@@ -59,3 +59,11 @@ function _extends() { _extends = Object.assign || function (target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i]; for (var key in source) { if (Object.prototype.hasOwnProperty.call(source, key)) { target[key] = source[key]; } } } return target; }; return _extends.apply(this, arguments); } | ||
var query = new URLSearchParams(_extends({}, action.payload.searchTemplate.template, { | ||
var template = _extends({}, action.payload.searchTemplate.template); | ||
for (var param in template) { | ||
if (template[param] === undefined || template[param] === null) { | ||
delete template[param]; | ||
} | ||
} | ||
var query = new URLSearchParams(_extends({}, template, { | ||
page: String(action.payload.pageNumber), | ||
@@ -67,3 +75,3 @@ pageSize: String(action.payload.pageSize) | ||
yield put(actions.searchSuccess({ | ||
records: result.data, | ||
records: result.resultSetSize > 0 ? result.data : [], | ||
resultSetSize: result.resultsetSize | ||
@@ -70,0 +78,0 @@ })); |
{ | ||
"name": "@jfront/core-redux-saga", | ||
"version": "0.4.0", | ||
"version": "0.4.1", | ||
"license": "Apache-2.0", | ||
@@ -28,3 +28,3 @@ "main": "dist/cjs/index.js", | ||
"dependencies": { | ||
"@jfront/core-rest": "^0.3.0" | ||
"@jfront/core-rest": "^0.3.1" | ||
}, | ||
@@ -36,3 +36,3 @@ "peerDependencies": { | ||
}, | ||
"gitHead": "0cb708272c99ab71b8cb61324ef96af07f6a2f4d" | ||
"gitHead": "d267fcc4dfb4893f858be5849fbdb2b8b5d82f9a" | ||
} |
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
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
161372
1676
Updated@jfront/core-rest@^0.3.1