Closed guspatagonico closed 4 months ago
Hi! I found the example code for AlertBoxField to be wrong. Reference url: https://github.com/NouanceLabs/payload-better-fields-plugin?search=1#usage-7
import { CollectionConfig } from 'payload/types' import { AlertBoxField } from '@nouance/payload-better-fields-plugin' const Examples: CollectionConfig = { slug: 'examples', admin: { useAsTitle: 'title', }, fields: [ { name: 'title', type: 'text', }, ...AlertBoxField({ name: 'alert', { type: 'info', message: 'Please be aware that the title is required for the mobile app.', } }), ], } export default Examples
My proposed correction is this:
import { CollectionConfig } from 'payload/types' import { AlertBoxField } from '@nouance/payload-better-fields-plugin' const Examples: CollectionConfig = { slug: 'examples', admin: { useAsTitle: 'title', }, fields: [ { name: 'title', type: 'text', }, ...AlertBoxField( { name: 'alert' }, { type: 'info', message: 'Please be aware that the title is required for the mobile app.', } ), ], } export default Examples
Best regards. Gustavo
Thanks for bringing this up, will be fixed in the next release!
Hi! I found the example code for AlertBoxField to be wrong. Reference url: https://github.com/NouanceLabs/payload-better-fields-plugin?search=1#usage-7
My proposed correction is this:
Best regards. Gustavo