add media_name
prop for other routes
This commit is contained in:
@ -27,7 +27,7 @@ export const CarrierCreate = () => {
|
||||
resource: 'media',
|
||||
onSearch: (value) => [
|
||||
{
|
||||
field: 'filename',
|
||||
field: 'media_name',
|
||||
operator: 'contains',
|
||||
value,
|
||||
},
|
||||
@ -183,13 +183,13 @@ export const CarrierCreate = () => {
|
||||
field.onChange(value?.id || '')
|
||||
}}
|
||||
getOptionLabel={(item) => {
|
||||
return item ? item.filename : ''
|
||||
return item ? item.media_name : ''
|
||||
}}
|
||||
isOptionEqualToValue={(option, value) => {
|
||||
return option.id === value?.id
|
||||
}}
|
||||
filterOptions={(options, {inputValue}) => {
|
||||
return options.filter((option) => option.filename.toLowerCase().includes(inputValue.toLowerCase()))
|
||||
return options.filter((option) => option.media_name.toLowerCase().includes(inputValue.toLowerCase()))
|
||||
}}
|
||||
renderInput={(params) => <TextField {...params} label="Выберите логотип" margin="normal" variant="outlined" error={!!errors.logo} helperText={(errors as any)?.logo?.message} />}
|
||||
/>
|
||||
|
Reference in New Issue
Block a user