From ed54036d46eb825ff2eb5633c1956afa92175fd4 Mon Sep 17 00:00:00 2001 From: Dylan Mendelowitz Date: Wed, 13 Oct 2021 12:25:10 -0400 Subject: [PATCH] Changing notificationInfo schema for easier use in UI --- src/application/app.js | 2 +- src/helpers/schemas/config.schema.json | 11 +++++++---- 2 files changed, 8 insertions(+), 5 deletions(-) diff --git a/src/application/app.js b/src/application/app.js index da3b4c8f..5cf49533 100644 --- a/src/application/app.js +++ b/src/application/app.js @@ -43,7 +43,7 @@ async function mcodeApp(Client, fromDate, toDate, config, pathToRunLogs, debug, // If we have notification information, send an emailNotification const { notificationInfo } = config; - if (notificationInfo) { + if (notificationInfo && Object.keys(notificationInfo).length > 0) { const notificationErrors = zipErrors(totalExtractionErrors); try { await sendEmailNotification(notificationInfo, notificationErrors, debug); diff --git a/src/helpers/schemas/config.schema.json b/src/helpers/schemas/config.schema.json index be659c9c..9a56df53 100644 --- a/src/helpers/schemas/config.schema.json +++ b/src/helpers/schemas/config.schema.json @@ -79,10 +79,13 @@ "type": "boolean" } }, - "required": [ - "host", - "to" - ] + "dependencies": { + "host": { "required": ["to"] }, + "to": { "required": ["host"] }, + "from": { "required": ["host", "to"] }, + "port": { "required": ["host", "to"] }, + "tlsRejectUnauthorized": { "required": ["host", "to"] } + } }, "extractor": { "title": "Extractor",