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

20 lines
389 B
TypeScript

import { CreateContainerRequest } from '../types';
import { RestartPolicy } from './types';
export function toRequest(
config: CreateContainerRequest,
value: RestartPolicy
): CreateContainerRequest {
return {
...config,
HostConfig: {
...config.HostConfig,
RestartPolicy: {
...config.HostConfig.RestartPolicy,
Name: value,
},
},
};
}