Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Validation function not called for "relation" custom fields #1000

Closed
michaelbromley opened this issue Jul 22, 2021 · 0 comments
Closed

Validation function not called for "relation" custom fields #1000

michaelbromley opened this issue Jul 22, 2021 · 0 comments
Assignees
Labels
type: bug 🐛 Something isn't working @vendure/core

Comments

@michaelbromley
Copy link
Member

Describe the bug
If a validate function is defined for a custom field of type 'relation' it does not get called when creating or updating an entity with that custom field.

Expected behavior
The validate function should be invoked.

Environment (please complete the following information):

  • @vendure/core version: 1.1.2
  • Nodejs version: any
  • Database (mysql/postgres etc): any

Additional context
The root cause is that relation custom fields are named <name>Id rather than just <name> as is the case with all other types. This difference is overlooked in the validation logic here so those fields do not get validated.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
type: bug 🐛 Something isn't working @vendure/core
Projects
None yet
Development

No branches or pull requests

1 participant