batchnz / craft-commerce-untitled

A Craft Commerce plugin for minting variants based on field values
MIT License
0 stars 1 forks source link

Fix dynamic validation rule for sku -> all setting #1

Closed moacode closed 3 years ago

moacode commented 3 years ago

The validation rules for the all setting needs to be updated to support sku values. At the moment they are set to a number type, but this needs to be a string type.

Current validation rule:

.when(METHOD, {
  is: "all",
  then: lazy((obj) =>
    object({
      value: number()
        .typeError("Please enter a number")
        .required("Please enter a value")
        .min(0, "Please enter a value greater than 0"),
    })
  ),
})
moacode commented 3 years ago

Estimate 30mins to 1 hour.

moacode commented 3 years ago

@judereid this has been resolved.