We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent e092249 commit ee96c11Copy full SHA for ee96c11
1 file changed
examples/actions/schema.ts
@@ -43,13 +43,10 @@ export const lists = {
43
title: text(),
44
content: text({
45
hooks: {
46
- validate: args => {
47
- if (
48
- typeof args.resolvedFieldData === 'string' &&
49
- !args.resolvedFieldData.includes('good content')
50
- ) {
51
- args.addValidationError('Content is not valid')
52
- }
+ validate: ({ resolvedFieldData, addValidationError }) => {
+ if (typeof resolvedFieldData !== 'string') return
+ if (resolvedFieldData.includes('good content')) return
+ addValidationError('Content is not valid')
53
},
54
55
}),
0 commit comments