NouanceLabs / payload-better-fields-plugin

This plugin aims to provide you with very specific and improved fields for the Payload admin panel.
MIT License
124 stars 2 forks source link

Custom slugify.remove value not applied #69

Closed slavanossar closed 4 months ago

slavanossar commented 4 months ago

When defining a custom remove value, the value is lost when the custom slugify config is merged with the default.

image

slugify.remove ends up being an empty object after the deepMerge.

SlugField(
  {
    name: 'slug',
    admin: { position: 'sidebar' },
  },
  {
    useFields: ['clientName'],
    slugify: { remove: /[*+~.()'"\/!?#\.,:@]/g },
  },
)
slavanossar commented 4 months ago

Would probably be good to update the default to include / characters, which is why I was trying to add a custom regex.

paulpopus commented 4 months ago

Hey thanks for the bug report. Pushed a fix now which fixes this config problem and I added \ and / to the default regex