Ghost/ghost/express-dynamic-redirects
Simon Backx 7e556d84de Fixed adding same redirect multiple times throws an error on removal (#379)
refs https://ghost.slack.com/archives/C02G9E68C/p1647599592576139

When you add a redirect multiple times, and remove it afterwards, an error is thrown:
`Cannot destructure property 'fromRegex' of 'this.redirects[redirectId]' as it is undefined.` 
This was caused by `redirectIds` that contained the same id multiple times.

* Added a test for adding a redirect multiple times and removing it once
* Fixed adding same redirect multiple times throws an error on removal
2022-03-24 09:54:19 +01:00
..
lib Fixed adding same redirect multiple times throws an error on removal (#379) 2022-03-24 09:54:19 +01:00
test Fixed adding same redirect multiple times throws an error on removal (#379) 2022-03-24 09:54:19 +01:00
.eslintrc.js
index.js
LICENSE 2022 2022-01-06 10:09:25 +00:00
package.json Published new versions 2022-03-11 22:45:26 +01:00
README.md

Express Dynamic Redirects

Install

npm install @tryghost/express-dynamic-redirects --save

or

yarn add @tryghost/express-dynamic-redirects

Usage

Develop

This is a mono repository, managed with lerna.

Follow the instructions for the top-level repo.

  1. git clone this repo & cd into it as usual
  2. Run yarn to install top-level dependencies.

Run

  • yarn dev

Test

  • yarn lint run just eslint
  • yarn test run lint and tests