🐛 fix(purchasing): Update payment type to lowercase and add optional chaining for discounts
This commit is contained in:
@@ -40,7 +40,7 @@ const DurationSelector: React.FC<DurationSelectorProps> = ({
|
||||
);
|
||||
|
||||
// 查找当前选中项的折扣信息
|
||||
const currentDiscount = discounts.find((item) => item.quantity === quantity)?.discount;
|
||||
const currentDiscount = discounts?.find((item) => item.quantity === quantity)?.discount;
|
||||
const discountPercentage = currentDiscount ? 100 - currentDiscount : 0;
|
||||
|
||||
return (
|
||||
|
||||
Reference in New Issue
Block a user