payload-default-value-gen
TypeScript icon, indicating that this package has built-in type declarations

1.0.5 • Public • Published

Generating default-value function Plugin

Generating default-value function (like uuid) plugin for Payload CMS.

Documentation

Please refer to the documentations for the installation and usages.

Usage

Under payload.config.ts:

export default buildConfig({
  // ..other payload configs
  plugins: [
    // ..other plugins
    genDefaultValueForIdPlugin({
      // list of collection(s) to apply 
      collections: ['slug_name_1', 'slug_name_2'],
      // function to generate each time to
      defaultFunc: () => uuidv4()
    })
    // storage-adapter-placeholder
  ],
})

Package Sidebar

Install

npm i payload-default-value-gen

Weekly Downloads

7

Version

1.0.5

License

MIT

Unpacked Size

8.14 kB

Total Files

7

Last publish

Collaborators

  • kfiross44