feat(plugin-redirects)!: update fields overrides to use a function (#6675)
## Description
Updates the `fields` override in plugin redirects to allow for
overriding
```ts
// before
overrides: {
fields: [
{
type: 'text',
name: 'customField',
},
],
},
// current
overrides: {
fields: ({ defaultFields }) => {
return [
...defaultFields,
{
type: 'text',
name: 'customField',
},
]
},
},
```
## Type of change
- [x] New feature (non-breaking change which adds functionality)
- [x] Breaking change (fix or feature that would cause existing
functionality to not work as expected)
This commit is contained in:
@@ -27,6 +27,17 @@ export default buildConfigWithDefaults({
|
||||
plugins: [
|
||||
redirectsPlugin({
|
||||
collections: ['pages'],
|
||||
overrides: {
|
||||
fields: ({ defaultFields }) => {
|
||||
return [
|
||||
...defaultFields,
|
||||
{
|
||||
type: 'text',
|
||||
name: 'customField',
|
||||
},
|
||||
]
|
||||
},
|
||||
},
|
||||
}),
|
||||
],
|
||||
})
|
||||
|
||||
Reference in New Issue
Block a user