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:
parent
dfa88360ea
commit
93e392fac1
1 changed files with 6 additions and 6 deletions
|
@ -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;
|
||||
|
|
Loading…
Add table
Reference in a new issue