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"
This commit is contained in:
Naz 2021-11-29 16:08:03 +04:00
parent 2dc4f3209f
commit eb6d1b208a

View File

@ -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;