management-sdk icon indicating copy to clipboard operation
management-sdk copied to clipboard

Update Simple Field doesn't work for validation.

Open MichalCzerwonka opened this issue 4 years ago • 0 comments

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

MichalCzerwonka avatar Feb 16 '22 19:02 MichalCzerwonka