Skip to content

Commit

Permalink
Merge pull request #66 from afadil/dev
Browse files Browse the repository at this point in the history
fix activity form
  • Loading branch information
afadil authored Sep 7, 2024
2 parents f716153 + d08ff86 commit 44c4841
Show file tree
Hide file tree
Showing 6 changed files with 11 additions and 11 deletions.
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
{
"name": "wealthfolio-app",
"private": true,
"version": "1.0.7",
"version": "1.0.8",
"type": "module",
"scripts": {
"dev": "vite",
Expand Down
2 changes: 1 addition & 1 deletion src-tauri/Cargo.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion src-tauri/Cargo.toml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
[package]
name = "wealthfolio-app"
version = "1.0.7"
version = "1.0.8"
description = "Portfolio tracker"
authors = ["Aziz Fadil"]
license = "LGPL-3.0"
Expand Down
2 changes: 1 addition & 1 deletion src-tauri/tauri.conf.json
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@
},
"package": {
"productName": "Wealthfolio",
"version": "1.0.7"
"version": "1.0.8"
},
"tauri": {
"allowlist": {
Expand Down
6 changes: 3 additions & 3 deletions src/lib/schemas.ts
Original file line number Diff line number Diff line change
Expand Up @@ -42,15 +42,15 @@ export const newActivitySchema = z.object({
required_error: 'Please enter a valid fee.',
invalid_type_error: 'Fee must be a positive number.',
})
.min(0, { message: 'Fee must be a positive number.' }),
.min(0, { message: 'Fee must be a non-negative number.' }),

isDraft: z.boolean(),
quantity: z.coerce
.number({
required_error: 'Please enter a valid quantity.',
invalid_type_error: 'Quantity must be a positive number.',
})
.min(0, { message: 'Quantity must be a positive number.' }),
.positive({ message: 'Quantity must be a positive number.' }),
assetId: z.string().min(1, { message: 'Asset ID is required' }),
activityType: z.enum([
'BUY',
Expand All @@ -72,6 +72,6 @@ export const newActivitySchema = z.object({
required_error: 'Please enter a valid price.',
invalid_type_error: 'Price must be a positive number.',
})
.min(0, { message: 'Price must be a positive number.' }),
.positive({ message: 'Price must be a positive number.' }),
comment: z.string().optional(),
});
8 changes: 4 additions & 4 deletions src/pages/activity/components/activity-form.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -142,7 +142,7 @@ export function ActivityForm({ accounts, defaultValues, onSuccess = () => {} }:
</DialogDescription>
</DialogHeader>

<div className="grid gap-6 p-4 ">
<div className="grid gap-6 p-4">
{addActivityMutation.error && (
<AlertFeedback
variant="error"
Expand Down Expand Up @@ -369,7 +369,7 @@ const AssetActivityFields = ({ defaultAssetId }: AssetActivityFieldsProps) => {
<FormItem>
<FormLabel>Shares</FormLabel>
<FormControl>
<Input type="number" inputMode="decimal" min="0" placeholder="Shares" {...field} />
<Input type="number" inputMode="decimal" placeholder="Shares" {...field} />
</FormControl>
<FormMessage />
</FormItem>
Expand All @@ -382,7 +382,7 @@ const AssetActivityFields = ({ defaultAssetId }: AssetActivityFieldsProps) => {
<FormItem>
<FormLabel>Price</FormLabel>
<FormControl>
<Input type="number" inputMode="decimal" min="0" placeholder="Price" {...field} />
<Input type="number" inputMode="decimal" placeholder="Price" {...field} />
</FormControl>
<FormMessage />
</FormItem>
Expand All @@ -395,7 +395,7 @@ const AssetActivityFields = ({ defaultAssetId }: AssetActivityFieldsProps) => {
<FormItem>
<FormLabel>Fee</FormLabel>
<FormControl>
<Input type="number" inputMode="decimal" min="0" placeholder="Fee" {...field} />
<Input type="number" inputMode="decimal" placeholder="Fee" {...field} />
</FormControl>
<FormMessage />
</FormItem>
Expand Down

0 comments on commit 44c4841

Please sign in to comment.