Skip to main content

custom

Use custom validators for needs that are more specific than can be handled with provided validators. Add a validation error with this.addError(column, message) rather than throwing or assigning directly to this.errors:

export default class Sandbag extends ApplicationModel {
...

@deco.Validate()
public validateWeightConsistency(this: Sandbag) {
if (this.weight && this.weightKgs) {
this.addError('weight', 'cannot include both weight and weightKgs')
}
}
}