Closed IrynaMatviichuk closed 2 years ago
@IraMatviichuk I've just checked and QueryFailedError
doesn't give an information which exact field had an error plus SQL Driver generated message isn't something we should be showing to the end user.
I think your best bet would be to use class-validator
to set validation rules for your entities as it's integrated with @adminjs/typeorm
.
Getting same issue with and without class-validator. Using typeorm. If a field is required on a create new entry form, a message is shown "There are validation errors - check them out below" - but nothing is shown on the web page, in the web page console logs, in the network traffic, or in the adminjs logs.
Describe the bug I use adminjs with TypeOrm and when I try to save the wrong data, TypeOrm throws an error but this error is not displayed in adminjs.
You can see how this validation error looks in the console on the first screenshot. As you can see the field name of this error is undefined. And there are no errors displayed near 'code' field.
Installed libraries and their versions
Expected behavior I expect to receive errors object with correct field name and have these errors displayed
Screenshots
AdminJSOptions with schema