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

fix(ui): Fix min replica yup validation schema #391

Merged

Conversation

deadlycoconuts
Copy link
Contributor

Context

This PR introduces an additional fix to the yup validation schema, as a follow up from #387. In particular, the fix in this PR addresses this change:

  • When using the same Schema.when function but passing a function directly as an argument instead of the builder object, the signature of the expected function has also been updated from (value, schema)=> Schema): Schema to (values: any[], schema) => Schema): Schema.

    Existing schemas that do not follow this convention now have been updated to reflect the new expected array:

    Example:

    // before
    some_field: yup.string().when("some_other_field", (some_other_field, schema) =>
      some_other_field ? yup.string().required("this is needed") : schema
    ),
    
    // after
    some_field: yup.string().when("some_other_field", ([some_other_field], schema) =>
      some_other_field ? yup.string().required("this is needed") : schema
    ),

@deadlycoconuts deadlycoconuts added the type: bug Something isn't working label Aug 7, 2024
@deadlycoconuts deadlycoconuts self-assigned this Aug 7, 2024
Copy link
Contributor

@tiopramayudi tiopramayudi left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Add question, the rest is LGTM!

@deadlycoconuts
Copy link
Contributor Author

Thanks for the second approval @tiopramayudi 😂

@deadlycoconuts deadlycoconuts merged commit e850d9d into caraml-dev:main Aug 8, 2024
12 checks passed
@deadlycoconuts deadlycoconuts deleted the fix_min_replica_yup_schema branch August 8, 2024 04:20
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
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants