File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change 1- import { RegisterOptions , FieldValues } from "react-hook-form" ;
2- import { BasicGenFields } from "../features/constants" ;
1+ import { RegisterOptions } from "react-hook-form" ;
2+ import { BasicGenFields , BugFixFields } from "../features/constants" ;
33
4- export const validateForm = ( fieldName : BasicGenFields ) => {
5- let validationRules : RegisterOptions < FieldValues , BasicGenFields > = { } ;
4+ export const validateForm = ( fieldName : string ) => {
5+ let validationRules : RegisterOptions = { } ;
66 switch ( fieldName ) {
77 case BasicGenFields . MIN_TOKEN :
88 validationRules = {
@@ -28,13 +28,16 @@ export const validateForm = (fieldName: BasicGenFields) => {
2828 } ,
2929 } ;
3030 break ;
31+ case BugFixFields . VERSION :
32+ case BugFixFields . BUG_DESCRIPTION :
3133 case BasicGenFields . INPUT :
3234 validationRules = {
3335 required : {
3436 value : true ,
3537 message : "Input can not be empty" ,
3638 } ,
3739 } ;
40+ break ;
3841 }
3942 return validationRules ;
4043} ;
You can’t perform that action at this time.
0 commit comments