~ fix validation errors for inputs

This commit is contained in:
maxim 2025-02-04 17:05:21 +03:00
parent dda02078cc
commit 6c251f5a7a
9 changed files with 46 additions and 46 deletions

View File

@ -21,8 +21,8 @@ export const ArticleCreate = () => {
{...register('heading', {
required: 'This field is required',
})}
error={!!(errors as any)?.title}
helperText={(errors as any)?.title?.message}
error={!!(errors as any)?.heading}
helperText={(errors as any)?.heading?.message}
margin="normal"
fullWidth
InputLabelProps={{shrink: true}}
@ -34,8 +34,8 @@ export const ArticleCreate = () => {
{...register('body', {
required: 'This field is required',
})}
error={!!(errors as any)?.title}
helperText={(errors as any)?.title?.message}
error={!!(errors as any)?.body}
helperText={(errors as any)?.body?.message}
margin="normal"
fullWidth
InputLabelProps={{shrink: true}}

View File

@ -16,8 +16,8 @@ export const ArticleEdit = () => {
{...register('heading', {
required: 'This field is required',
})}
error={!!(errors as any)?.title}
helperText={(errors as any)?.title?.message}
error={!!(errors as any)?.heading}
helperText={(errors as any)?.heading?.message}
margin="normal"
fullWidth
InputLabelProps={{shrink: true}}
@ -29,8 +29,8 @@ export const ArticleEdit = () => {
{...register('body', {
required: 'This field is required',
})}
error={!!(errors as any)?.title}
helperText={(errors as any)?.title?.message}
error={!!(errors as any)?.body}
helperText={(errors as any)?.body?.message}
margin="normal"
fullWidth
InputLabelProps={{shrink: true}}

View File

@ -46,8 +46,8 @@ export const CityCreate = () => {
{...register('name', {
required: 'This field is required',
})}
error={!!(errors as any)?.title}
helperText={(errors as any)?.title?.message}
error={!!(errors as any)?.name}
helperText={(errors as any)?.name?.message}
margin="normal"
fullWidth
InputLabelProps={{shrink: true}}

View File

@ -17,8 +17,8 @@ export const CountryCreate = () => {
{...register('code', {
required: 'This field is required',
})}
error={!!(errors as any)?.title}
helperText={(errors as any)?.title?.message}
error={!!(errors as any)?.code}
helperText={(errors as any)?.code?.message}
margin="normal"
fullWidth
InputLabelProps={{shrink: true}}
@ -30,8 +30,8 @@ export const CountryCreate = () => {
{...register('name', {
required: 'This field is required',
})}
error={!!(errors as any)?.title}
helperText={(errors as any)?.title?.message}
error={!!(errors as any)?.name}
helperText={(errors as any)?.name?.message}
margin="normal"
fullWidth
InputLabelProps={{shrink: true}}

View File

@ -16,8 +16,8 @@ export const CountryEdit = () => {
{...register('code', {
required: 'This field is required',
})}
error={!!(errors as any)?.title}
helperText={(errors as any)?.title?.message}
error={!!(errors as any)?.code}
helperText={(errors as any)?.code?.message}
margin="normal"
fullWidth
InputLabelProps={{shrink: true}}
@ -29,8 +29,8 @@ export const CountryEdit = () => {
{...register('name', {
required: 'This field is required',
})}
error={!!(errors as any)?.title}
helperText={(errors as any)?.title?.message}
error={!!(errors as any)?.name}
helperText={(errors as any)?.name?.message}
margin="normal"
fullWidth
InputLabelProps={{shrink: true}}

View File

@ -27,8 +27,8 @@ export const SightCreate = () => {
{...register('name', {
required: 'This field is required',
})}
error={!!(errors as any)?.title}
helperText={(errors as any)?.title?.message}
error={!!(errors as any)?.name}
helperText={(errors as any)?.name?.message}
margin="normal"
fullWidth
InputLabelProps={{shrink: true}}
@ -41,8 +41,8 @@ export const SightCreate = () => {
required: 'This field is required',
valueAsNumber: true,
})}
error={!!(errors as any)?.title}
helperText={(errors as any)?.title?.message}
error={!!(errors as any)?.latitude}
helperText={(errors as any)?.latitude?.message}
margin="normal"
fullWidth
InputLabelProps={{shrink: true}}
@ -55,8 +55,8 @@ export const SightCreate = () => {
required: 'This field is required',
valueAsNumber: true,
})}
error={!!(errors as any)?.title}
helperText={(errors as any)?.title?.message}
error={!!(errors as any)?.longitude}
helperText={(errors as any)?.longitude?.message}
margin="normal"
fullWidth
InputLabelProps={{shrink: true}}

View File

@ -22,8 +22,8 @@ export const SightEdit = () => {
{...register('name', {
required: 'This field is required',
})}
error={!!(errors as any)?.title}
helperText={(errors as any)?.title?.message}
error={!!(errors as any)?.name}
helperText={(errors as any)?.name?.message}
margin="normal"
fullWidth
InputLabelProps={{shrink: true}}
@ -36,8 +36,8 @@ export const SightEdit = () => {
required: 'This field is required',
valueAsNumber: true,
})}
error={!!(errors as any)?.title}
helperText={(errors as any)?.title?.message}
error={!!(errors as any)?.latitude}
helperText={(errors as any)?.latitude?.message}
margin="normal"
fullWidth
InputLabelProps={{shrink: true}}
@ -50,8 +50,8 @@ export const SightEdit = () => {
required: 'This field is required',
valueAsNumber: true,
})}
error={!!(errors as any)?.title}
helperText={(errors as any)?.title?.message}
error={!!(errors as any)?.longitude}
helperText={(errors as any)?.longitude?.message}
margin="normal"
fullWidth
InputLabelProps={{shrink: true}}

View File

@ -21,8 +21,8 @@ export const StationCreate = () => {
{...register('name', {
required: 'This field is required',
})}
error={!!(errors as any)?.title}
helperText={(errors as any)?.title?.message}
error={!!(errors as any)?.name}
helperText={(errors as any)?.name?.message}
margin="normal"
fullWidth
InputLabelProps={{shrink: true}}
@ -34,8 +34,8 @@ export const StationCreate = () => {
{...register('description', {
required: 'This field is required',
})}
error={!!(errors as any)?.title}
helperText={(errors as any)?.title?.message}
error={!!(errors as any)?.description}
helperText={(errors as any)?.description?.message}
margin="normal"
fullWidth
InputLabelProps={{shrink: true}}
@ -48,8 +48,8 @@ export const StationCreate = () => {
required: 'This field is required',
valueAsNumber: true,
})}
error={!!(errors as any)?.title}
helperText={(errors as any)?.title?.message}
error={!!(errors as any)?.latitude}
helperText={(errors as any)?.latitude?.message}
margin="normal"
fullWidth
InputLabelProps={{shrink: true}}
@ -62,8 +62,8 @@ export const StationCreate = () => {
required: 'This field is required',
valueAsNumber: true,
})}
error={!!(errors as any)?.title}
helperText={(errors as any)?.title?.message}
error={!!(errors as any)?.longitude}
helperText={(errors as any)?.longitude?.message}
margin="normal"
fullWidth
InputLabelProps={{shrink: true}}

View File

@ -16,8 +16,8 @@ export const StationEdit = () => {
{...register('name', {
required: 'This field is required',
})}
error={!!(errors as any)?.title}
helperText={(errors as any)?.title?.message}
error={!!(errors as any)?.name}
helperText={(errors as any)?.name?.message}
margin="normal"
fullWidth
InputLabelProps={{shrink: true}}
@ -29,8 +29,8 @@ export const StationEdit = () => {
{...register('description', {
required: 'This field is required',
})}
error={!!(errors as any)?.title}
helperText={(errors as any)?.title?.message}
error={!!(errors as any)?.description}
helperText={(errors as any)?.description?.message}
margin="normal"
fullWidth
InputLabelProps={{shrink: true}}
@ -43,8 +43,8 @@ export const StationEdit = () => {
required: 'This field is required',
valueAsNumber: true,
})}
error={!!(errors as any)?.title}
helperText={(errors as any)?.title?.message}
error={!!(errors as any)?.latitude}
helperText={(errors as any)?.latitude?.message}
margin="normal"
fullWidth
InputLabelProps={{shrink: true}}
@ -57,8 +57,8 @@ export const StationEdit = () => {
required: 'This field is required',
valueAsNumber: true,
})}
error={!!(errors as any)?.title}
helperText={(errors as any)?.title?.message}
error={!!(errors as any)?.longitude}
helperText={(errors as any)?.longitude?.message}
margin="normal"
fullWidth
InputLabelProps={{shrink: true}}