From f5da831290d57d4113810cbff04dbd2714bf4d02 Mon Sep 17 00:00:00 2001 From: Sergei Maertens Date: Fri, 17 Jan 2025 20:19:45 +0100 Subject: [PATCH] :coffin: [open-formulieren/open-forms#4929] Remove onFailure prop It's no longer necessary. --- src/components/PostCompletionViews/ConfirmationView.jsx | 8 +------- src/components/PostCompletionViews/StartPaymentView.jsx | 8 +------- 2 files changed, 2 insertions(+), 14 deletions(-) diff --git a/src/components/PostCompletionViews/ConfirmationView.jsx b/src/components/PostCompletionViews/ConfirmationView.jsx index 76fdbd1b5..7ffa90164 100644 --- a/src/components/PostCompletionViews/ConfirmationView.jsx +++ b/src/components/PostCompletionViews/ConfirmationView.jsx @@ -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 @@ -127,7 +127,6 @@ const ConfirmationView = ({returnTo, onFailure, onConfirmed}) => { { - onFailure?.(error); if (returnTo) { const newState = {...(location.state || {}), errorMessage: error}; navigate(returnTo, {state: newState}); @@ -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 diff --git a/src/components/PostCompletionViews/StartPaymentView.jsx b/src/components/PostCompletionViews/StartPaymentView.jsx index a680bce77..2111b786c 100644 --- a/src/components/PostCompletionViews/StartPaymentView.jsx +++ b/src/components/PostCompletionViews/StartPaymentView.jsx @@ -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 || {}; @@ -70,7 +70,6 @@ const StartPaymentView = ({returnTo, onFailure}) => { { - onFailure(error); if (returnTo) { const newState = {...(location.state || {}), errorMessage: error}; navigate(returnTo, {state: newState}); @@ -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;