FIX: create network_config type and plugin default values

This commit is contained in:
Gabriel Rosa
2022-08-10 12:33:35 -03:00
parent 7c5cf3f541
commit fa11df5684
2 changed files with 12 additions and 7 deletions
@@ -91,7 +91,11 @@ export class NetworkConfigService {
file: Express.Multer.File,
{ customer_name, customer_id },
): Promise<CreateNetworkConfigRes> {
const { description, name, type, network_type_id, plugin } = body;
const { description, name, network_type_id } = body;
let { type, plugin } = body;
type = type || 'vpn';
plugin = plugin || 'openvpn';
const OVPN_FILE_STRING = Buffer.from(file.buffer).toString();