mirror of https://github.com/portainer/portainer
18 lines
374 B
TypeScript
18 lines
374 B
TypeScript
import { CreateContainerRequest } from '../types';
|
|
|
|
import { Values } from './types';
|
|
|
|
export function toRequest(
|
|
oldConfig: CreateContainerRequest,
|
|
values: Values
|
|
): CreateContainerRequest {
|
|
return {
|
|
...oldConfig,
|
|
Labels: Object.fromEntries(
|
|
values
|
|
.filter((label) => label.name)
|
|
.map((label) => [label.name, label.value])
|
|
),
|
|
};
|
|
}
|