Skip to content

Commit

Permalink
feat: add disableArrayWarning option to SlugOptions (#7174)
Browse files Browse the repository at this point in the history
  • Loading branch information
Stelkooo authored Dec 9, 2024
1 parent 5e3b8c1 commit 1b5fd00
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 1 deletion.
1 change: 1 addition & 0 deletions packages/@sanity/types/src/schema/definition/type/slug.ts
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,7 @@ export interface SlugOptions extends SearchConfiguration, BaseSchemaTypeOptions
maxLength?: number
slugify?: SlugifierFn
isUnique?: SlugIsUniqueValidator
disableArrayWarning?: boolean
}

/** @public */
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@ function serializePath(path: Path): string {

const defaultIsUnique: SlugIsUniqueValidator = (slug, context) => {
const {getClient, document, path, type} = context
const schemaOptions = type?.options as {disableArrayWarning?: boolean} | undefined
const schemaOptions = type?.options

if (!document) {
throw new Error(`\`document\` was not provided in validation context.`)
Expand Down

0 comments on commit 1b5fd00

Please sign in to comment.