FIX: Connection and Network Flows (Create and Delete)

This commit is contained in:
Victor Radael
2022-08-17 15:58:00 -03:00
parent 6807b3e1a9
commit a9f68b87ca
6 changed files with 59 additions and 64 deletions
@@ -91,9 +91,9 @@ export class NetworkConfigService {
async createNetworkConfig(
body: CreateNetworkConfigReq,
file: Express.Multer.File,
{ customer_name, customer_id },
{ customer_name, customer_id, user_id },
): Promise<CreateNetworkConfigRes> {
const { description, name, network_type_id } = body;
const { description, name, network_type_id, network_type_name } = body;
let { type, plugin } = body;
type = type || 'vpn';
@@ -102,12 +102,14 @@ export class NetworkConfigService {
const OVPN_FILE_STRING = Buffer.from(file.buffer).toString();
const meta = new Metadata();
meta.add('customer_id', customer_id);
meta.add('customer_name', customer_name);
meta.add('user_id', user_id);
const { network_config } = await lastValueFrom(
this.networkConfigWriteClient.NetworkConfigCreate(
{
customer_name,
description,
name,
properties: JSON.stringify({
@@ -116,6 +118,8 @@ export class NetworkConfigService {
}),
type,
network_type_id,
network_type_name,
plugin,
},
meta,
),