Skip to content

Commit

Permalink
⚰️ [open-formulieren/open-forms#4929] Remove onFailure prop
Browse files Browse the repository at this point in the history
It's no longer necessary.
  • Loading branch information
sergei-maertens committed Jan 17, 2025
1 parent 537d743 commit f5da831
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 14 deletions.
8 changes: 1 addition & 7 deletions src/components/PostCompletionViews/ConfirmationView.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -107,7 +107,7 @@ ConfirmationViewDisplay.propTypes = {
downloadPDFText: PropTypes.node,
};

const ConfirmationView = ({returnTo, onFailure, onConfirmed}) => {
const ConfirmationView = ({returnTo, onConfirmed}) => {
const form = useFormContext();
// TODO: take statusUrl from session storage instead of router state / query params,
// which is the best tradeoff between security and convenience (state doesn't survive
Expand All @@ -127,7 +127,6 @@ const ConfirmationView = ({returnTo, onFailure, onConfirmed}) => {
<StatusUrlPoller
statusUrl={statusUrl}
onFailure={error => {
onFailure?.(error);
if (returnTo) {
const newState = {...(location.state || {}), errorMessage: error};
navigate(returnTo, {state: newState});
Expand All @@ -145,11 +144,6 @@ ConfirmationView.propTypes = {
* Location to navigate to on failure.
*/
returnTo: PropTypes.string,
/**
* Optional callback to invoke when processing failed.
* @deprecated
*/
onFailure: PropTypes.func,
/**
* Optional callback to invoke when processing was successful.
* @deprecated
Expand Down
8 changes: 1 addition & 7 deletions src/components/PostCompletionViews/StartPaymentView.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -61,7 +61,7 @@ StartPaymentViewDisplay.propTypes = {
downloadPDFText: PropTypes.node,
};

const StartPaymentView = ({returnTo, onFailure}) => {
const StartPaymentView = ({returnTo}) => {
const form = useFormContext();
const navigate = useNavigate();
const {statusUrl} = useLocation().state || {};
Expand All @@ -70,7 +70,6 @@ const StartPaymentView = ({returnTo, onFailure}) => {
<StatusUrlPoller
statusUrl={statusUrl}
onFailure={error => {

Check warning on line 72 in src/components/PostCompletionViews/StartPaymentView.jsx

View check run for this annotation

Codecov / codecov/patch

src/components/PostCompletionViews/StartPaymentView.jsx#L72

Added line #L72 was not covered by tests
onFailure(error);
if (returnTo) {
const newState = {...(location.state || {}), errorMessage: error};
navigate(returnTo, {state: newState});

Check warning on line 75 in src/components/PostCompletionViews/StartPaymentView.jsx

View check run for this annotation

Codecov / codecov/patch

src/components/PostCompletionViews/StartPaymentView.jsx#L75

Added line #L75 was not covered by tests
Expand All @@ -87,11 +86,6 @@ StartPaymentView.propTypes = {
* Location to navigate to on failure.
*/
returnTo: PropTypes.string,
/**
* Optional callback to invoke when processing failed.
* @deprecated
*/
onFailure: PropTypes.func,
};

export default StartPaymentView;
Expand Down

0 comments on commit f5da831

Please sign in to comment.