diff --git a/src/views/LoanDetails/LoanProxyDetails.js b/src/views/LoanDetails/LoanProxyDetails.js index de6c20bff..8adcc7853 100644 --- a/src/views/LoanDetails/LoanProxyDetails.js +++ b/src/views/LoanDetails/LoanProxyDetails.js @@ -27,6 +27,7 @@ class LoanProxyDetails extends React.Component { mutator: PropTypes.shape({ proxy: PropTypes.shape({ GET: PropTypes.func.isRequired, + reset: PropTypes.func.isRequired, }).isRequired, }).isRequired, showErrorCallout: PropTypes.func.isRequired, @@ -34,6 +35,7 @@ class LoanProxyDetails extends React.Component { componentDidMount() { if (this.props.id) { + this.props.mutator.proxy.reset(); this.props.mutator.proxy.GET() .catch(() => { this.props.showErrorCallout('ui-users.errors.proxyBorrowerNotFound'); @@ -43,6 +45,7 @@ class LoanProxyDetails extends React.Component { getUserFullName() { const proxy = (this.props.resources.proxy || {}).records || []; + console.log('proxy.length: ', proxy.length); if (proxy.length === 1 && proxy[0].id === this.props.id) { return {getFullName(proxy[0])}; } diff --git a/src/views/LoanDetails/LoanProxyDetails.test.js b/src/views/LoanDetails/LoanProxyDetails.test.js index 63b76c35e..bdc5b35c8 100644 --- a/src/views/LoanDetails/LoanProxyDetails.test.js +++ b/src/views/LoanDetails/LoanProxyDetails.test.js @@ -27,6 +27,7 @@ const props = (propID, proxyID) => { mutator: { proxy: { GET: jest.fn().mockResolvedValueOnce(proxyData), + reset: jest.fn(), }, }, showErrorCallout: showErrorMock,