feat: add validation for max 2 decimal places on non-sat currencies
🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
This commit is contained in:
parent
3c16ebb2b7
commit
bcdd001e1b
1 changed files with 3 additions and 3 deletions
|
|
@ -59,8 +59,8 @@
|
|||
:step="zoneDialog.data.currency != 'sat' ? '0.01' : '1'"
|
||||
type="number"
|
||||
v-model.trim="zoneDialog.data.cost"
|
||||
:error="zoneDialog.data.currency === 'sat' && zoneDialog.data.cost % 1 !== 0"
|
||||
error-message="Satoshis must be whole numbers"
|
||||
:error="(zoneDialog.data.currency === 'sat' && zoneDialog.data.cost % 1 !== 0) || (zoneDialog.data.currency !== 'sat' && (zoneDialog.data.cost * 100) % 1 !== 0)"
|
||||
:error-message="zoneDialog.data.currency === 'sat' ? 'Satoshis must be whole numbers' : 'Maximum 2 decimal places allowed'"
|
||||
hint="Additional costs can be set per product"
|
||||
></q-input>
|
||||
</div>
|
||||
|
|
@ -93,7 +93,7 @@
|
|||
<q-btn
|
||||
unelevated
|
||||
color="primary"
|
||||
:disable="!zoneDialog.data.countries || !zoneDialog.data.countries.length || (zoneDialog.data.currency === 'sat' && zoneDialog.data.cost % 1 !== 0)"
|
||||
:disable="!zoneDialog.data.countries || !zoneDialog.data.countries.length || (zoneDialog.data.currency === 'sat' && zoneDialog.data.cost % 1 !== 0) || (zoneDialog.data.currency !== 'sat' && (zoneDialog.data.cost * 100) % 1 !== 0)"
|
||||
type="submit"
|
||||
>Create Shipping Zone</q-btn
|
||||
>
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue