SearchPage uses storableError func and correct proptype validation.

This commit is contained in:
Vesa Luusua 2017-10-17 19:47:54 +03:00
parent f68cf153af
commit 347699de91
2 changed files with 7 additions and 6 deletions

View file

@ -1,4 +1,5 @@
import { unionWith } from 'lodash';
import { storableError } from '../../util/errors';
import { addMarketplaceEntities } from '../../ducks/marketplaceData.duck';
// ================ Action types ================ //
@ -124,7 +125,7 @@ export const searchListings = searchParams => (dispatch, getState, sdk) => {
return response;
})
.catch(e => {
dispatch(searchListingsError(e));
dispatch(searchListingsError(storableError(e)));
throw e;
});
};
@ -146,7 +147,7 @@ export const searchMapListings = searchParams => (dispatch, getState, sdk) => {
return response;
})
.catch(e => {
dispatch(searchMapListingsError(e));
dispatch(searchMapListingsError(storableError(e)));
throw e;
});
};

View file

@ -354,19 +354,19 @@ SearchPageComponent.defaultProps = {
tab: 'listings',
};
const { array, bool, func, instanceOf, oneOf, object, shape, string } = PropTypes;
const { array, bool, func, oneOf, object, shape, string } = PropTypes;
SearchPageComponent.propTypes = {
authInfoError: instanceOf(Error),
authInfoError: propTypes.error,
listings: array,
mapListings: array,
logoutError: instanceOf(Error),
logoutError: propTypes.error,
onManageDisableScrolling: func.isRequired,
onSearchMapListings: func.isRequired,
pagination: propTypes.pagination,
scrollingDisabled: bool.isRequired,
searchInProgress: bool.isRequired,
searchListingsError: instanceOf(Error),
searchListingsError: propTypes.error,
searchParams: object,
tab: oneOf(['filters', 'listings', 'map']).isRequired,