From eb6d1b208ae2ae6206559fb0fa48664d98ce024a Mon Sep 17 00:00:00 2001 From: Naz Date: Mon, 29 Nov 2021 16:08:03 +0400 Subject: [PATCH] Made options parameter optional refs https://github.com/TryGhost/Toolbox/issues/139 - The options parameter doesn't have to be passed in as there is handling for a default value in place - "permanent = false" --- .../express-dynamic-redirects/lib/DynamicRedirectManager.js | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/ghost/express-dynamic-redirects/lib/DynamicRedirectManager.js b/ghost/express-dynamic-redirects/lib/DynamicRedirectManager.js index 34304710ad..e9211451fd 100644 --- a/ghost/express-dynamic-redirects/lib/DynamicRedirectManager.js +++ b/ghost/express-dynamic-redirects/lib/DynamicRedirectManager.js @@ -87,12 +87,12 @@ class DynamicRedirectManager { /** * @param {string} from * @param {string} to - * @param {object} options - * @param {boolean} options.permanent + * @param {object} [options] + * @param {boolean} [options.permanent] * * @returns {string} The redirect ID */ - addRedirect(from, to, options) { + addRedirect(from, to, options = {}) { try { const fromRegex = this.buildRegex(from); const redirectId = from;