Had to set up a custom validation on the beforeCreate event, since i only need this rule applied on record creation, not updates.
If there is a better way to do this please let me know!
The problem is that the notification text prepends the text ‘success’ to my error message.
The error object i throw in the lifecycle event seems correct, the field is highlighted and the validation error is also shown below the input control.
Am i missing some property from my error object?
throw new utils.errors.YupValidationError({
errors: [''],
value: data?.myField,
data: data,
type: 'warning',
path: 'myField',
name: 'ValidationError',
message: 'no good',
inner: [],
}, 'error: bad user!');
This shows the notification: ‘success error: bad user’, with the correct error style, panel is red.
‘no good’ is shown below the highlighted control.
System Information
- Strapi Version: 4.13
- Operating System: win
- Database: mysql
- Node Version: 18.18.0
- NPM Version: 9.8.1
- Yarn Version: