From 305436bb8b91d251e1eb9fc6859b226ece23d3f3 Mon Sep 17 00:00:00 2001 From: Miroslav Jancarik Date: Fri, 11 Jun 2021 22:00:19 +0200 Subject: [PATCH] =?UTF-8?q?feat:=20=F0=9F=8E=B8=20GenericError=20can=20mod?= =?UTF-8?q?ify=20action=20and=20options=20params?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- packages/core/src/router/ClientRouter.js | 14 +++++++++++++- 1 file changed, 13 insertions(+), 1 deletion(-) diff --git a/packages/core/src/router/ClientRouter.js b/packages/core/src/router/ClientRouter.js index 5a81fb4ff7..ae2605bb79 100644 --- a/packages/core/src/router/ClientRouter.js +++ b/packages/core/src/router/ClientRouter.js @@ -206,8 +206,20 @@ export default class ClientRouter extends AbstractRouter { } if (this.isRedirection(params.error)) { + let errorParams = params.error.getParams(); options.httpStatus = params.error.getHttpStatus(); - this.redirect(params.error.getParams().url, options); + let action = { + event: null, + type: ActionTypes.REDIRECT, + url: errorParams.url + }; + + this.redirect( + errorParams.url, + Object.assign(options, errorParams.options), + Object.assign(action, errorParams.action), + locals + ); return Promise.resolve({ content: null, status: options.httpStatus,