portainer/app/react/docker/containers/CreateView/RestartPolicyTab/validation.ts

10 lines
272 B
TypeScript

import { mixed, SchemaOf } from 'yup';
import { RestartPolicy } from './types';
export function validation(): SchemaOf<RestartPolicy> {
return mixed<RestartPolicy>()
.oneOf(Object.values(RestartPolicy))
.default(RestartPolicy.No) as SchemaOf<RestartPolicy>;
}