adminjs icon indicating copy to clipboard operation
adminjs copied to clipboard

[Bug]: Relation custom validation error

Open xitrumIT opened this issue 7 months ago • 1 comments

Contact Details

No response

What happened?

I am using adminjs for my project, but when using the relation between tables together, it works, but how can I customize the error in this relation modal? In the example, I am assigning a task that this user does not have permission for. My wish is to be able to customize Error to make it more meaningful.

Image

Bug prevalence

Add existing item relation

AdminJS dependencies version

"@adminjs/relations": "^1.1.2", "adminjs": "^7.7.2",

What browsers do you see the problem on?

No response

Relevant log output


Relevant code that's giving you issues


xitrumIT avatar May 20 '25 09:05 xitrumIT

in all these cases I create a before handler or and after handler and manage custom errors. For instance If i have some unique check I run this check in a before and in case of error I raise a ValidationError with my own messages tied to the properties non fulfilling the unique. if error cannot be attached to any input I raise an AppError with a dedicated message.

captHarlock69 avatar Aug 28 '25 16:08 captHarlock69