From ba2f2d6e9b66568b11632bacdd92cfdc8ddae300 Mon Sep 17 00:00:00 2001 From: Elliot DeNolf Date: Fri, 9 Dec 2022 09:40:05 -0500 Subject: [PATCH] feat!: no longer sanitize collection slugs to kebab case (#1607) BREAKING CHANGE: collection slugs are no longer automatically sanitized to be kebab case. This will only be an issue if your current slugs were in camel case. The upgrade path will be to change those slugs to the kebab case version that the slug was automatically being sanitized to on the backend. If you only use kebab case or single word slugs: no action needed. If you have existing slugs with camel case and populated data: you'll need to convert these to the kebab case version to match the previously sanitized value. ie. myOldSlug is your slug, you should convert it to my-old-slug. Any future slugs after updating will be used as-is. --- src/collections/config/sanitize.ts | 2 -- 1 file changed, 2 deletions(-) diff --git a/src/collections/config/sanitize.ts b/src/collections/config/sanitize.ts index 4fed5c9065..c635e3fc27 100644 --- a/src/collections/config/sanitize.ts +++ b/src/collections/config/sanitize.ts @@ -2,7 +2,6 @@ import merge from 'deepmerge'; import { isPlainObject } from 'is-plain-object'; import { SanitizedCollectionConfig, CollectionConfig } from './types'; import sanitizeFields from '../../fields/config/sanitize'; -import toKebabCase from '../../utilities/toKebabCase'; import baseAuthFields from '../../auth/baseFields/auth'; import baseAPIKeyFields from '../../auth/baseFields/apiKey'; import baseVerificationFields from '../../auth/baseFields/verification'; @@ -25,7 +24,6 @@ const sanitizeCollection = (config: Config, collection: CollectionConfig): Sanit isMergeableObject: isPlainObject, }); - sanitized.slug = toKebabCase(sanitized.slug); sanitized.labels = sanitized.labels || formatLabels(sanitized.slug); if (sanitized.versions) {