Fixed length of from field in the RedirectsImporter (#20034)

no issue

- The `RedirectsImporter` used by the data generator was creating
redirects with the wrong length for the `from` field, which didn't match
the actual behavior of Ghost.
- This commit corrects the length from 32 to 8, which is the actual
length of the `from` field in production.
- This change has no impact on Ghost's behavior, but makes the data
generator more representative of real world data for more accurate
testing.
This commit is contained in:
Chris Raible 2024-04-22 18:11:14 -07:00 committed by GitHub
parent a2bbe6b3c3
commit d8672cb1ff
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194

View File

@ -37,7 +37,7 @@ class RedirectsImporter extends TableImporter {
this.amount -= 1;
return {
id: this.fastFakeObjectId(),
from: `/r/${faker.datatype.hexadecimal({length: 32, prefix: '', case: 'lower'})}`,
from: `/r/${faker.datatype.hexadecimal({length: 8, prefix: '', case: 'lower'})}`,
to: `${faker.internet.url()}/${faker.helpers.slugify(`${faker.word.adjective()} ${faker.word.noun()}`).toLowerCase()}`,
post_id: this.model.id,
created_at: this.model.published_at,