Integrated both events into the webhook.js integration

This commit is contained in:
Mathias Wagner
2023-05-23 16:56:30 +02:00
parent ca8894ee6f
commit e2d14419c3
+11 -1
View File
@@ -23,6 +23,14 @@ module.exports = (registerEvent) => {
if (integration.data.send_failed) await postWebhook(integration.data.url, "TEST_FAILED", {error}, activity);
});
registerEvent('recommendationsUpdated', async (integration, data, activity) => {
if (integration.data.send_recommendations) await postWebhook(integration.data.url, "RECOMMENDATIONS_UPDATED", data, activity);
});
registerEvent('configUpdated', async (integration, data, activity) => {
if (integration.data.send_config_updates) await postWebhook(integration.data.url, "CONFIG_UPDATED", data, activity);
});
return {
icon: "fa-solid fa-globe",
fields: [
@@ -30,7 +38,9 @@ module.exports = (registerEvent) => {
{name: "send_started", type: "boolean", required: false},
{name: "send_finished", type: "boolean", required: false},
{name: "send_alive", type: "boolean", required: false},
{name: "send_failed", type: "boolean", required: false}
{name: "send_failed", type: "boolean", required: false},
{name: "send_recommendations", type: "boolean", required: false},
{name: "send_config_updates", type: "boolean", required: false}
]
};
}