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

Update Simple Field doesn't work for validation. #21

Open
MichalCzerwonka opened this issue Feb 16, 2022 · 0 comments
Open

Update Simple Field doesn't work for validation. #21

MichalCzerwonka opened this issue Feb 16, 2022 · 0 comments

Comments

@MichalCzerwonka
Copy link

MichalCzerwonka commented Feb 16, 2022

Hi,

I've noticed that updating a validation on field using updateSimpleField doesn't work. When I try to do that I'm getting an error:

Error: field validations not supported for undefined at extractFieldValidations

From what I was able to find it was happen because updateSimpleField use extractFieldValidations which require a type to work:

Zrzut ekranu 2022-02-16 o 20 48 20

But the typescript type definition for the updated model does not allow us to pass it. (This is understandable, we can't pass the type because we can't update it.) :

Zrzut ekranu 2022-02-16 o 20 55 38

Temporary workaround is to pass a type in updateSimpleField and disable warning from typescript. The type must be the same as the field already exists in:

Zrzut ekranu 2022-02-16 o 20 56 34

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant