0
Fork 0
mirror of https://github.com/TryGhost/Ghost.git synced 2025-02-03 23:00:14 -05:00

Added explicit enum to newsletters.status

closes: https://github.com/TryGhost/Team/issues/1553

- we want to be explicit in what values are supported
- we want the values that are supported to be supported to also be explicit and clear
- without this API users can set the value to anything and the active/not active logic will work, until such time as we introduce further statuses
- this means introducing a new status could be a potential breaking change and lands us in horrible hot water
This commit is contained in:
Hannah Wolfe 2022-04-25 11:56:54 +01:00 committed by Matt Hanley
parent 4f3743bb60
commit 37a684c2c5
2 changed files with 3 additions and 3 deletions

View file

@ -16,7 +16,7 @@ module.exports = {
sender_name: {type: 'string', maxlength: 191, nullable: true},
sender_email: {type: 'string', maxlength: 191, nullable: true},
sender_reply_to: {type: 'string', maxlength: 191, nullable: false, defaultTo: 'newsletter', validations: {isIn: [['newsletter', 'support']]}},
status: {type: 'string', maxlength: 50, nullable: false, defaultTo: 'active'},
status: {type: 'string', maxlength: 50, nullable: false, defaultTo: 'active', validations: {isIn: [['active', 'archived']]}},
visibility: {
type: 'string',
maxlength: 50,

View file

@ -1281,7 +1281,7 @@ DataGenerator.forKnex = (function () {
member_id: DataGenerator.Content.members[4].id,
newsletter_id: DataGenerator.Content.newsletters[1].id
},
// Member index 5 (vip@test.com), subscribed to an active and inactive newsletter
// Member index 5 (vip@test.com), subscribed to an active and archived newsletter
{
id: ObjectId().toHexString(),
member_id: DataGenerator.Content.members[5].id,
@ -1292,7 +1292,7 @@ DataGenerator.forKnex = (function () {
member_id: DataGenerator.Content.members[5].id,
newsletter_id: DataGenerator.Content.newsletters[2].id
},
// Member index 6 (vip-paid@test.com), subscribed to an inactive newsletter
// Member index 6 (vip-paid@test.com), subscribed to an archived newsletter
{
id: ObjectId().toHexString(),
member_id: DataGenerator.Content.members[6].id,