Skip to content

Commit ed54036

Browse files
committed
Changing notificationInfo schema for easier use in UI
1 parent 806d3bc commit ed54036

File tree

2 files changed

+8
-5
lines changed

2 files changed

+8
-5
lines changed

src/application/app.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -43,7 +43,7 @@ async function mcodeApp(Client, fromDate, toDate, config, pathToRunLogs, debug,
4343

4444
// If we have notification information, send an emailNotification
4545
const { notificationInfo } = config;
46-
if (notificationInfo) {
46+
if (notificationInfo && Object.keys(notificationInfo).length > 0) {
4747
const notificationErrors = zipErrors(totalExtractionErrors);
4848
try {
4949
await sendEmailNotification(notificationInfo, notificationErrors, debug);

src/helpers/schemas/config.schema.json

Lines changed: 7 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -79,10 +79,13 @@
7979
"type": "boolean"
8080
}
8181
},
82-
"required": [
83-
"host",
84-
"to"
85-
]
82+
"dependencies": {
83+
"host": { "required": ["to"] },
84+
"to": { "required": ["host"] },
85+
"from": { "required": ["host", "to"] },
86+
"port": { "required": ["host", "to"] },
87+
"tlsRejectUnauthorized": { "required": ["host", "to"] }
88+
}
8689
},
8790
"extractor": {
8891
"title": "Extractor",

0 commit comments

Comments
 (0)