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

16 lines
421 B
JavaScript

/**
* Copyright (c) HashiCorp, Inc.
* SPDX-License-Identifier: MPL-2.0
*/
import { validatePresence } from 'ember-changeset-validations/validators';
import validateSometimes from 'consul-ui/validations/sometimes';
export default (schema) => ({
Name: [validatePresence(true)],
Value: [
validateSometimes(validatePresence(true), function () {
return this.get('HeaderType') !== 'Present';
}),
],
});