File tree Expand file tree Collapse file tree 1 file changed +6
-4
lines changed
apps/frontend/src/components/launches/helpers Expand file tree Collapse file tree 1 file changed +6
-4
lines changed Original file line number Diff line number Diff line change 11import { useEffect , useMemo } from 'react' ;
22import { useForm , useFormContext } from 'react-hook-form' ;
33import { classValidatorResolver } from '@hookform/resolvers/class-validator' ;
4+
5+ class Empty { }
6+
47const finalInformation = { } as {
58 [ key : string ] : {
69 posts : Array < {
@@ -42,15 +45,14 @@ export const useValues = (
4245 ) => Promise < string | true > ,
4346 maximumCharacters ?: number
4447) => {
45- const resolver = useMemo ( ( ) => {
46- return dto ? classValidatorResolver ( dto ) : undefined ;
47- } , [ integration ] ) ;
48+
4849 const form = useForm ( {
49- ... ( resolver ? resolver : { } ) ,
50+ resolver : classValidatorResolver ( dto || Empty ) ,
5051 values : initialValues ,
5152 mode : 'onChange' ,
5253 criteriaMode : 'all' ,
5354 } ) ;
55+
5456 const getValues = useMemo ( ( ) => {
5557 return ( ) => ( {
5658 ...form . getValues ( ) ,
You can’t perform that action at this time.
0 commit comments