mirror of
https://github.com/kingomarnajjar/flex-template-web.git
synced 2026-07-26 06:47:17 +10:00
SalePage and panel uses storableError func and correct proptype validation.
This commit is contained in:
parent
d8520f8e6d
commit
f68cf153af
3 changed files with 13 additions and 12 deletions
|
|
@ -267,7 +267,7 @@ SaleDetailsPanelComponent.defaultProps = {
|
|||
declineSaleError: null,
|
||||
};
|
||||
|
||||
const { string, func, bool, instanceOf } = PropTypes;
|
||||
const { bool, func, string } = PropTypes;
|
||||
|
||||
SaleDetailsPanelComponent.propTypes = {
|
||||
rootClassName: string,
|
||||
|
|
@ -277,8 +277,8 @@ SaleDetailsPanelComponent.propTypes = {
|
|||
onDeclineSale: func.isRequired,
|
||||
acceptInProgress: bool.isRequired,
|
||||
declineInProgress: bool.isRequired,
|
||||
acceptSaleError: instanceOf(Error),
|
||||
declineSaleError: instanceOf(Error),
|
||||
acceptSaleError: propTypes.error,
|
||||
declineSaleError: propTypes.error,
|
||||
|
||||
// from injectIntl
|
||||
intl: intlShape.isRequired,
|
||||
|
|
|
|||
|
|
@ -1,4 +1,5 @@
|
|||
import { types } from '../../util/sdkLoader';
|
||||
import { storableError } from '../../util/errors';
|
||||
import * as propTypes from '../../util/propTypes';
|
||||
import * as log from '../../util/log';
|
||||
import { addMarketplaceEntities } from '../../ducks/marketplaceData.duck';
|
||||
|
|
@ -122,7 +123,7 @@ export const fetchSale = id => (dispatch, getState, sdk) => {
|
|||
return response;
|
||||
})
|
||||
.catch(e => {
|
||||
dispatch(fetchSaleError(e));
|
||||
dispatch(fetchSaleError(storableError(e)));
|
||||
throw e;
|
||||
});
|
||||
};
|
||||
|
|
@ -142,7 +143,7 @@ export const acceptSale = id => (dispatch, getState, sdk) => {
|
|||
return response;
|
||||
})
|
||||
.catch(e => {
|
||||
dispatch(acceptSaleError(e));
|
||||
dispatch(acceptSaleError(storableError(e)));
|
||||
log.error(e, 'accept-sale-failed', {
|
||||
txId: id,
|
||||
transition: propTypes.TX_TRANSITION_ACCEPT,
|
||||
|
|
@ -166,7 +167,7 @@ export const declineSale = id => (dispatch, getState, sdk) => {
|
|||
return response;
|
||||
})
|
||||
.catch(e => {
|
||||
dispatch(declineSaleError(e));
|
||||
dispatch(declineSaleError(storableError(e)));
|
||||
log.error(e, 'redect-sale-failed', {
|
||||
txId: id,
|
||||
transition: propTypes.TX_TRANSITION_DECLINE,
|
||||
|
|
|
|||
|
|
@ -103,18 +103,18 @@ SalePageComponent.defaultProps = {
|
|||
transaction: null,
|
||||
};
|
||||
|
||||
const { bool, func, instanceOf, oneOf, shape, string } = PropTypes;
|
||||
const { bool, func, oneOf, shape, string } = PropTypes;
|
||||
|
||||
SalePageComponent.propTypes = {
|
||||
authInfoError: instanceOf(Error),
|
||||
authInfoError: propTypes.error,
|
||||
currentUser: propTypes.currentUser,
|
||||
fetchSaleError: instanceOf(Error),
|
||||
acceptSaleError: instanceOf(Error),
|
||||
declineSaleError: instanceOf(Error),
|
||||
fetchSaleError: propTypes.error,
|
||||
acceptSaleError: propTypes.error,
|
||||
declineSaleError: propTypes.error,
|
||||
acceptInProgress: bool.isRequired,
|
||||
declineInProgress: bool.isRequired,
|
||||
intl: intlShape.isRequired,
|
||||
logoutError: instanceOf(Error),
|
||||
logoutError: propTypes.error,
|
||||
onAcceptSale: func.isRequired,
|
||||
onDeclineSale: func.isRequired,
|
||||
params: shape({ id: string }).isRequired,
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue