Updates expense input to EUR
Updates the expense input fields to accept and display amounts in Euros instead of satoshis. This change ensures that the amount field is configured to handle decimal values with a minimum value of €0.01.
This commit is contained in:
parent
e3a8c4b096
commit
c934720bb9
1 changed files with 7 additions and 7 deletions
|
|
@ -80,18 +80,18 @@
|
||||||
<!-- Amount -->
|
<!-- Amount -->
|
||||||
<FormField v-slot="{ componentField }" name="amount">
|
<FormField v-slot="{ componentField }" name="amount">
|
||||||
<FormItem>
|
<FormItem>
|
||||||
<FormLabel>Amount (sats) *</FormLabel>
|
<FormLabel>Amount (EUR) *</FormLabel>
|
||||||
<FormControl>
|
<FormControl>
|
||||||
<Input
|
<Input
|
||||||
type="number"
|
type="number"
|
||||||
placeholder="0"
|
placeholder="0.00"
|
||||||
v-bind="componentField"
|
v-bind="componentField"
|
||||||
min="1"
|
min="0.01"
|
||||||
step="1"
|
step="0.01"
|
||||||
/>
|
/>
|
||||||
</FormControl>
|
</FormControl>
|
||||||
<FormDescription>
|
<FormDescription>
|
||||||
Amount in satoshis
|
Amount in Euros
|
||||||
</FormDescription>
|
</FormDescription>
|
||||||
<FormMessage />
|
<FormMessage />
|
||||||
</FormItem>
|
</FormItem>
|
||||||
|
|
@ -225,7 +225,7 @@ const isSubmitting = ref(false)
|
||||||
const formSchema = toTypedSchema(
|
const formSchema = toTypedSchema(
|
||||||
z.object({
|
z.object({
|
||||||
description: z.string().min(1, 'Description is required').max(500, 'Description too long'),
|
description: z.string().min(1, 'Description is required').max(500, 'Description too long'),
|
||||||
amount: z.coerce.number().min(1, 'Amount must be at least 1 sat'),
|
amount: z.coerce.number().min(0.01, 'Amount must be at least €0.01'),
|
||||||
reference: z.string().max(100, 'Reference too long').optional(),
|
reference: z.string().max(100, 'Reference too long').optional(),
|
||||||
isEquity: z.boolean().default(false)
|
isEquity: z.boolean().default(false)
|
||||||
})
|
})
|
||||||
|
|
@ -280,7 +280,7 @@ const onSubmit = form.handleSubmit(async (values) => {
|
||||||
is_equity: values.isEquity,
|
is_equity: values.isEquity,
|
||||||
user_wallet: wallet.id,
|
user_wallet: wallet.id,
|
||||||
reference: values.reference,
|
reference: values.reference,
|
||||||
currency: 'sats'
|
currency: 'EUR'
|
||||||
})
|
})
|
||||||
|
|
||||||
// Show success message
|
// Show success message
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue