Skip to content

Commit 08a0481

Browse files
authored
fix: isUnique can return a promise (#531)
1 parent b63d7a5 commit 08a0481

File tree

1 file changed

+4
-1
lines changed

1 file changed

+4
-1
lines changed

src/schema/fields.ts

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -354,7 +354,10 @@ interface SlugField extends BaseField {
354354
/**
355355
* Supply a custom function which checks whether or not the slug is unique. Receives the proposed slug as the first argument and an options object.
356356
*/
357-
isUnique?: (slug: string, options: SlugField['options']) => boolean
357+
isUnique?: (
358+
slug: string,
359+
options: SlugField['options']
360+
) => boolean | Promise<boolean>
358361
}
359362
validation?: Validator
360363
}

0 commit comments

Comments
 (0)