fix: Fix the gateway_ip when create network

Remove gateway_ip if it is empty

If the gateway_ip is empty, it should be removed
from the params of the request, otherwise it will cause
createing sub-net error

Change-Id: Iecd927034ca9bc14c1bfb28b27f34ef585afa945
This commit is contained in:
xusongfu 2022-02-22 15:26:22 +08:00
parent 0dcf7bd0e3
commit 4f40768854

View File

@ -322,7 +322,7 @@ export class NetworkStore extends Base {
allocation_pools, allocation_pools,
host_routes, host_routes,
ip_version: ip_version === 'ipv4' ? 4 : 6, ip_version: ip_version === 'ipv4' ? 4 : 6,
gateway_ip: disable_gateway ? null : gateway_ip, gateway_ip: disable_gateway || gateway_ip === '' ? null : gateway_ip,
cidr, cidr,
}; };
if (data.ip_version === 6) { if (data.ip_version === 6) {