chore: fix seed data validation in website template (#6491)

Fixes an issue with data validation in lexical for the seed script
This commit is contained in:
Paul
2024-05-24 11:10:29 -03:00
committed by GitHub
parent 7a768144ea
commit b4092f59ae

View File

@@ -59,6 +59,25 @@ export default buildConfig({
ItalicFeature(),
LinkFeature({
enabledCollections: ['pages', 'posts'],
fields: ({ defaultFields }) => {
const defaultFieldsWithoutUrl = defaultFields.filter((field) => {
if ('name' in field && field.name === 'url') return false
return true
})
return [
...defaultFieldsWithoutUrl,
{
name: 'url',
type: 'text',
admin: {
condition: ({ linkType }) => linkType !== 'internal',
},
label: ({ t }) => t('fields:enterURL'),
required: true,
},
]
},
}),
]
},