[2] fix required problem for project fields

This commit is contained in:
maxim
2025-03-28 02:26:18 +03:00
parent 754569b41d
commit d2e243ba64
6 changed files with 29 additions and 30 deletions

View File

@ -70,7 +70,6 @@ export const CityCreate = () => {
<Controller
control={control}
name="arms"
rules={{required: 'Это поле является обязательным'}}
defaultValue={null}
render={({field}) => (
<Autocomplete
@ -88,7 +87,7 @@ export const CityCreate = () => {
filterOptions={(options, {inputValue}) => {
return options.filter((option) => option.filename.toLowerCase().includes(inputValue.toLowerCase()))
}}
renderInput={(params) => <TextField {...params} label="Выберите герб" margin="normal" variant="outlined" error={!!errors.arms} helperText={(errors as any)?.arms?.message} required />}
renderInput={(params) => <TextField {...params} label="Выберите герб" margin="normal" variant="outlined" error={!!errors.arms} helperText={(errors as any)?.arms?.message} />}
/>
)}
/>

View File

@ -69,7 +69,7 @@ export const CityEdit = () => {
<Controller
control={control}
name="arms"
rules={{required: 'Это поле является обязательным'}}
// rules={{required: 'Это поле является обязательным'}}
defaultValue={null}
render={({field}) => (
<Autocomplete
@ -87,7 +87,7 @@ export const CityEdit = () => {
filterOptions={(options, {inputValue}) => {
return options.filter((option) => option.filename.toLowerCase().includes(inputValue.toLowerCase()))
}}
renderInput={(params) => <TextField {...params} label="Выберите герб" margin="normal" variant="outlined" error={!!errors.arms} helperText={(errors as any)?.arms?.message} required />}
renderInput={(params) => <TextField {...params} label="Выберите герб" margin="normal" variant="outlined" error={!!errors.arms} helperText={(errors as any)?.arms?.message} />}
/>
)}
/>