mirror of
https://github.com/portainer/portainer.git
synced 2025-07-21 22:39:41 +02:00
17 lines
374 B
TypeScript
17 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])
|
|
),
|
|
};
|
|
}
|