♻️ refactor(utils): optimize resetPricingFilters function for better maintainability (#1365)

- Extract default values to DEFAULT_PRICING_FILTERS constant for centralized configuration
- Replace verbose type checks with optional chaining operator (?.) for cleaner code
- Eliminate redundant function type validations and comments
- Reduce code lines by ~50% (from 60 to 25 lines) while maintaining full functionality
- Improve code readability and follow modern JavaScript best practices

This refactoring enhances code quality without changing the function's behavior,
making it easier to maintain and modify default filter values in the future.
This commit is contained in:
t0ng7u
2025-07-24 17:15:28 +08:00
parent 1880164e29
commit 2fe3706ef0

View File

@@ -577,7 +577,7 @@ export const calculateModelPrice = ({
tokenUnit,
displayPrice,
currency,
precision = 3
precision = 4
}) => {
if (record.quota_type === 0) {
// 按量计费