mirror of
https://github.com/TryGhost/Ghost.git
synced 2025-01-06 22:40:14 -05:00
Set negative pricing in Offers index to 0 (#19174)
fixes ADM-24 - sets a negative amount to 0 - this usually occurs if the tier amount was changed after the offer has been created.
This commit is contained in:
parent
f8ad5fb2ea
commit
9a6d71884b
1 changed files with 5 additions and 0 deletions
|
@ -59,6 +59,11 @@ export const getOfferDiscount = (type: string, amount: number, cadence: string,
|
|||
break;
|
||||
};
|
||||
|
||||
// Check if updatedPrice is negative, if so, set it to 0
|
||||
if (updatedPrice < 0) {
|
||||
updatedPrice = 0;
|
||||
}
|
||||
|
||||
const updatedPriceWithCurrency = getSymbol(currency) + numberWithCommas(formatToTwoDecimals(currencyToDecimal(updatedPrice)));
|
||||
|
||||
return {
|
||||
|
|
Loading…
Reference in a new issue