0
Fork 0
mirror of https://github.com/TryGhost/Ghost.git synced 2025-01-20 22:42:53 -05:00

Added error messages for monthly & yearly price validation

refs https://github.com/TryGhost/Team/issues/2078

These were missing, and will be refactored into the correct
tpl(messages.prop) format
This commit is contained in:
Fabien "egg" O'Carroll 2022-10-20 11:50:23 +07:00
parent dfa88360ea
commit 93e392fac1

View file

@ -350,17 +350,17 @@ function validateMonthlyPrice(value, type) {
}
if (!Number.isSafeInteger(value)) {
throw new ValidationError({
message: ''
message: 'Tier prices must be an integer.'
});
}
if (value < 0) {
throw new ValidationError({
message: ''
message: 'Tier prices must not be negative'
});
}
if (value > 9999999999) {
throw new ValidationError({
message: ''
message: 'Tier prices may not exceed 999999.99'
});
}
return value;
@ -377,17 +377,17 @@ function validateYearlyPrice(value, type) {
}
if (!Number.isSafeInteger(value)) {
throw new ValidationError({
message: ''
message: 'Tier prices must be an integer.'
});
}
if (value < 0) {
throw new ValidationError({
message: ''
message: 'Tier prices must not be negative'
});
}
if (value > 9999999999) {
throw new ValidationError({
message: ''
message: 'Tier prices may not exceed 999999.99'
});
}
return value;