open-consul/ui-v2/app/validations/intention-permission-http-h...

9 lines
356 B
JavaScript
Raw Normal View History

import { validatePresence } from 'ember-changeset-validations/validators';
import validateSometimes from 'ember-changeset-conditional-validations/validators/sometimes';
export default schema => ({
Name: [validatePresence(true)],
Value: validateSometimes([validatePresence(true)], function() {
return this.get('HeaderType') !== 'Present';
}),
});