Webhooks improved
This commit is contained in:
1 parent
a4cc64e9cd
commit
401ad83c44
2 files changed
+7
-3
No files matched your search
@@ -5,14 +5,18 @@ function newWebhookFunctions () {
|
||||
|
||||
return thisObject
|
||||
|
||||
function sendTestMessage (node) {
|
||||
function sendTestMessage (node, callBackFunction) {
|
||||
let testMessage = loadPropertyFromNodeConfig(node.payload, 'testMessage')
|
||||
let letURL = loadPropertyFromNodeConfig(node.payload, 'webhookURL')
|
||||
|
||||
callServer(testMessage, letURL, onResponse)
|
||||
|
||||
function onResponse (err) {
|
||||
console.log(err)
|
||||
if (err.result === GLOBAL.DEFAULT_OK_RESPONSE.result) {
|
||||
callBackFunction(GLOBAL.DEFAULT_OK_RESPONSE)
|
||||
} else {
|
||||
callBackFunction(GLOBAL.DEFAULT_FAIL_RESPONSE)
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -415,7 +415,7 @@ function newWorkspace () {
|
||||
break
|
||||
case 'Send Webhook Test Message':
|
||||
{
|
||||
functionLibraryWebhookFunctions.sendTestMessage(payload.node)
|
||||
functionLibraryWebhookFunctions.sendTestMessage(payload.node, callBackFunction)
|
||||
}
|
||||
break
|
||||
case 'Run Session':
|
||||
|
||||
Reference in new issue
Block a user