mirror of
https://github.com/dadosfera/maestro.git
synced 2026-11-25 02:50:05 +00:00
FIX: Create VPN using multipart form data to fetch file
This commit is contained in:
@@ -88,9 +88,13 @@ export class NetworkConfigService {
|
||||
|
||||
async createNetworkConfig(
|
||||
body: CreateNetworkConfigReq,
|
||||
file: Express.Multer.File,
|
||||
{ customer_name, customer_id },
|
||||
): Promise<CreateNetworkConfigRes> {
|
||||
const { description, name, properties, type, network_type_id } = body;
|
||||
const { description, name, type, network_type_id, plugin } = body;
|
||||
|
||||
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);
|
||||
@@ -100,7 +104,10 @@ export class NetworkConfigService {
|
||||
customer_name,
|
||||
description,
|
||||
name,
|
||||
properties: JSON.stringify(properties),
|
||||
properties: JSON.stringify({
|
||||
OVPN_FILE: OVPN_FILE_STRING,
|
||||
plugin,
|
||||
}),
|
||||
type,
|
||||
network_type_id,
|
||||
},
|
||||
|
||||
Reference in New Issue
Block a user