@shopgate/pwa-common-commerce 7.7.1-beta.1 → 7.8.0-beta.2
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
|
@@ -9,4 +9,4 @@ function _extends(){_extends=Object.assign||function(target){for(var i=1;i<argum
|
|
|
9
9
|
* @param {null|number} [cachedTime=null] The cache TTL.
|
|
10
10
|
* @param {Object} params additional params.
|
|
11
11
|
* @return {Function} The dispatched action.
|
|
12
|
-
*/var fetchCategoryProducts=function fetchCategoryProducts(_ref){var categoryId=_ref.categoryId,_ref$filters=_ref.filters,filters=_ref$filters===void 0?null:_ref$filters,_ref$offset=_ref.offset,offset=_ref$offset===void 0?0:_ref$offset,_ref$limit=_ref.limit,limit=_ref$limit===void 0?ITEMS_PER_LOAD:_ref$limit,sort=_ref.sort,_ref$cached=_ref.cached,cached=_ref$cached===void 0?true:_ref$cached,_ref$cachedTime=_ref.cachedTime,cachedTime=_ref$cachedTime===void 0?null:_ref$cachedTime,params=_ref.params;return function(dispatch,getState){var sortOrder=sort||getSortOrder(getState(),{categoryId:categoryId});dispatch(fetchProducts({cached:cached,cachedTime:cachedTime,params:_extends({categoryId:categoryId,offset:offset,limit:limit,sort:sortOrder},params),filters:filters}));};};/** @mixes {MutableFunction} */export default mutable(fetchCategoryProducts);
|
|
12
|
+
*/var fetchCategoryProducts=function fetchCategoryProducts(_ref){var categoryId=_ref.categoryId,_ref$filters=_ref.filters,filters=_ref$filters===void 0?null:_ref$filters,_ref$offset=_ref.offset,offset=_ref$offset===void 0?0:_ref$offset,_ref$limit=_ref.limit,limit=_ref$limit===void 0?ITEMS_PER_LOAD:_ref$limit,sort=_ref.sort,_ref$cached=_ref.cached,cached=_ref$cached===void 0?true:_ref$cached,_ref$cachedTime=_ref.cachedTime,cachedTime=_ref$cachedTime===void 0?null:_ref$cachedTime,params=_ref.params;return function(dispatch,getState){var sortOrder=sort||getSortOrder(getState(),{categoryId:categoryId});return dispatch(fetchProducts({cached:cached,cachedTime:cachedTime,params:_extends({categoryId:categoryId,offset:offset,limit:limit,sort:sortOrder},params),filters:filters}));};};/** @mixes {MutableFunction} */export default mutable(fetchCategoryProducts);
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@shopgate/pwa-common-commerce",
|
|
3
|
-
"version": "7.
|
|
3
|
+
"version": "7.8.0-beta.2",
|
|
4
4
|
"description": "Commerce library for the Shopgate Connect PWA.",
|
|
5
5
|
"license": "Apache-2.0",
|
|
6
6
|
"author": "Shopgate <support@shopgate.com>",
|
|
@@ -19,8 +19,8 @@
|
|
|
19
19
|
"reselect": "^3.0.1"
|
|
20
20
|
},
|
|
21
21
|
"devDependencies": {
|
|
22
|
-
"@shopgate/pwa-common": "7.
|
|
23
|
-
"@shopgate/pwa-core": "7.
|
|
22
|
+
"@shopgate/pwa-common": "7.8.0-beta.2",
|
|
23
|
+
"@shopgate/pwa-core": "7.8.0-beta.2",
|
|
24
24
|
"lodash": "^4.17.4",
|
|
25
25
|
"react": "~16.12.0",
|
|
26
26
|
"react-dom": "~16.12.0"
|
|
@@ -10,4 +10,5 @@ dispatch(requestSearchResults(searchPhrase,offset));}}));/**
|
|
|
10
10
|
*/if(promise instanceof Promise){promise.then(function(response){// Inspect the response object to determine, if it represents a search result, or an error.
|
|
11
11
|
if(response&&response.products&&Array.isArray(response.products)){// Dispatch the receive action when the response contains valid data.s
|
|
12
12
|
dispatch(receiveSearchResults(searchPhrase,offset,response));}else{// If no valid data is delivered within the response the error action is dispatched.
|
|
13
|
-
dispatch(errorSearchResults(searchPhrase,offset));}});}
|
|
13
|
+
dispatch(errorSearchResults(searchPhrase,offset));}});}// eslint-disable-next-line consistent-return
|
|
14
|
+
return promise;};};/** @mixes {MutableFunction} */export default mutable(fetchSearchResults);
|