Skip to content

Commit e5ffd06

Browse files
committed
feat: update ref intent auto gen
1 parent 431e0d0 commit e5ffd06

File tree

2 files changed

+4
-3
lines changed

2 files changed

+4
-3
lines changed

client/src/components/forms/intent.tsx

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,7 @@ import {
44
} from '@/lib/schema/intent-input'
55
import { TIntentInput } from '@/types/intent'
66
import { zodResolver } from '@hookform/resolvers/zod'
7+
import { createId } from '@paralleldrive/cuid2'
78
import _ from 'lodash'
89
import { Minus, Plus } from 'lucide-react'
910
import { useCallback } from 'react'
@@ -38,14 +39,13 @@ const IntentForm = ({ defaultValues, id = 'intent-form', onSubmit }: Props) => {
3839
const form = useForm<TIntentInputForm>({
3940
defaultValues: {
4041
trainType: 'manual',
42+
referenceId: createId(),
4143
...defaultValues,
4244
},
4345
resolver: zodResolver(schema),
4446
mode: 'onChange',
4547
})
4648

47-
console.log(form.formState.errors)
48-
4949
const watchTrainType = form.watch('trainType')
5050
const trainDescriptionWatch = useWatch({
5151
control: form.control,
@@ -369,6 +369,7 @@ const IntentForm = ({ defaultValues, id = 'intent-form', onSubmit }: Props) => {
369369
<Input
370370
{...field}
371371
placeholder={t('referenceId.placeholder')}
372+
disabled
372373
/>
373374
</FormControl>
374375
<FormMessage />

0 commit comments

Comments
 (0)