ui: Fix setting initial tagsMap in TenantForm.

This commit is contained in:
Orne Brocaar 2023-11-06 10:53:28 +00:00
parent 3f86bf6e71
commit b6d390b6ad

View File

@ -12,18 +12,18 @@ interface IProps {
} }
function TenantForm(props: IProps) { function TenantForm(props: IProps) {
const onFinish = (v: Tenant.AsObject) => { const onFinish = (values: Tenant.AsObject) => {
const values = Object.assign(props.initialValues.toObject(), v); const v = Object.assign(props.initialValues.toObject(), values);
let tenant = new Tenant(); let tenant = new Tenant();
tenant.setId(values.id); tenant.setId(v.id);
tenant.setName(values.name); tenant.setName(v.name);
tenant.setDescription(values.description); tenant.setDescription(v.description);
tenant.setCanHaveGateways(values.canHaveGateways); tenant.setCanHaveGateways(v.canHaveGateways);
tenant.setMaxGatewayCount(values.maxGatewayCount); tenant.setMaxGatewayCount(v.maxGatewayCount);
tenant.setMaxDeviceCount(values.maxDeviceCount); tenant.setMaxDeviceCount(v.maxDeviceCount);
tenant.setPrivateGatewaysUp(values.privateGatewaysUp); tenant.setPrivateGatewaysUp(v.privateGatewaysUp);
tenant.setPrivateGatewaysDown(values.privateGatewaysDown); tenant.setPrivateGatewaysDown(v.privateGatewaysDown);
// tags // tags
for (const elm of v.tagsMap) { for (const elm of v.tagsMap) {