Compare commits
2 Commits
| Author | SHA1 | Date | |
|---|---|---|---|
| 383638f702 | |||
| 5939763b57 |
@@ -1,6 +1,13 @@
|
||||
<a name="readme-top"></a>
|
||||
# Changelog
|
||||
|
||||
# [1.0.0-beta.33](https://github.com/perfect-panel/ppanel-web/compare/v1.0.0-beta.32...v1.0.0-beta.33) (2025-03-18)
|
||||
|
||||
|
||||
### 🐛 Bug Fixes
|
||||
|
||||
* **subscribe**: Handle optional values in price and discount calculations ([5939763](https://github.com/perfect-panel/ppanel-web/commit/5939763))
|
||||
|
||||
# [1.0.0-beta.32](https://github.com/perfect-panel/ppanel-web/compare/v1.0.0-beta.31...v1.0.0-beta.32) (2025-03-17)
|
||||
|
||||
|
||||
|
||||
@@ -564,7 +564,7 @@ export default function SubscribeForm<T extends Record<string, any>>({
|
||||
return {
|
||||
...data,
|
||||
price: evaluateWithPrecision(
|
||||
`${unit_price} * ${data.quantity} * ${data.discount} / 100`,
|
||||
`${unit_price || 0} * ${data.quantity || 0} * ${data.discount || 0} / 100`,
|
||||
),
|
||||
};
|
||||
},
|
||||
@@ -581,7 +581,7 @@ export default function SubscribeForm<T extends Record<string, any>>({
|
||||
return {
|
||||
...data,
|
||||
discount: evaluateWithPrecision(
|
||||
`${data.price} / ${data.quantity} / ${unit_price} * 100`,
|
||||
`${data.price || 0} / ${data.quantity || 0} / ${unit_price || 0} * 100`,
|
||||
),
|
||||
};
|
||||
},
|
||||
@@ -589,7 +589,6 @@ export default function SubscribeForm<T extends Record<string, any>>({
|
||||
]}
|
||||
value={field.value}
|
||||
onChange={(value) => {
|
||||
console.log(value);
|
||||
form.setValue(field.name, value);
|
||||
}}
|
||||
/>
|
||||
|
||||
+1
-1
@@ -1,6 +1,6 @@
|
||||
{
|
||||
"name": "ppanel-web",
|
||||
"version": "1.0.0-beta.32",
|
||||
"version": "1.0.0-beta.33",
|
||||
"private": true,
|
||||
"homepage": "https://github.com/perfect-panel/ppanel-web",
|
||||
"bugs": {
|
||||
|
||||
@@ -36,7 +36,7 @@ export function ObjectInput<T extends Record<string, any>>({
|
||||
let updatedState = { ...internalState, ...value };
|
||||
|
||||
fields.forEach((field) => {
|
||||
if (field.calculateValue) {
|
||||
if (field?.calculateValue) {
|
||||
updatedState = field.calculateValue(updatedState);
|
||||
}
|
||||
});
|
||||
|
||||
Reference in New Issue
Block a user