🐛 fix(purchasing): Update payment type to lowercase and add optional chaining for discounts

This commit is contained in:
web@ppanel
2025-03-13 00:06:42 +07:00
parent c3138a863d
commit c06ea49d6f
2 changed files with 2 additions and 2 deletions
@@ -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 (