diff --git a/services/frontend/src/components/Modal/network/form-utils.ts b/services/frontend/src/components/Modal/network/form-utils.ts index 9f29edb..478c45c 100644 --- a/services/frontend/src/components/Modal/network/form-utils.ts +++ b/services/frontend/src/components/Modal/network/form-utils.ts @@ -1,5 +1,10 @@ import * as yup from "yup"; -import { IEditNetworkForm, INetworkNodeItem, IPAMConfig } from "../../../types"; +import { + IEditNetworkForm, + IIPAM, + INetworkNodeItem, + IPAMConfig +} from "../../../types"; import { pruneArray, pruneObject } from "../../../utils/forms"; export const validationSchema = yup.object({ @@ -135,7 +140,7 @@ export const getFinalValues = ( }, networkConfig: { name: values.networkName, - ipam: { + ipam: pruneObject({ driver: driver ? driver : undefined, config: pruneArray( configurations.map((configuration) => @@ -177,7 +182,7 @@ export const getFinalValues = ( options.map((option) => [option.key, option.value]) ); })() - }, + }) as IIPAM, labels: Object.fromEntries( labels.map((label) => [label.key, label.value]) )