|
|
@ -16,20 +16,22 @@ class Webhook extends NotificationProvider {
|
|
|
|
msg,
|
|
|
|
msg,
|
|
|
|
};
|
|
|
|
};
|
|
|
|
let finalData;
|
|
|
|
let finalData;
|
|
|
|
let config = {};
|
|
|
|
let config = {
|
|
|
|
|
|
|
|
headers: {}
|
|
|
|
|
|
|
|
};
|
|
|
|
|
|
|
|
|
|
|
|
if (notification.webhookContentType === "form-data") {
|
|
|
|
if (notification.webhookContentType === "form-data") {
|
|
|
|
finalData = new FormData();
|
|
|
|
finalData = new FormData();
|
|
|
|
finalData.append("data", JSON.stringify(data));
|
|
|
|
finalData.append("data", JSON.stringify(data));
|
|
|
|
|
|
|
|
config.headers = finalData.getHeaders();
|
|
|
|
config = {
|
|
|
|
|
|
|
|
headers: finalData.getHeaders(),
|
|
|
|
|
|
|
|
};
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
} else {
|
|
|
|
} else {
|
|
|
|
finalData = data;
|
|
|
|
finalData = data;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
if (notification.webhookAuthorizationHeader) {
|
|
|
|
|
|
|
|
config.headers["Authorization"] = notification.webhookAuthorizationHeader;
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
await axios.post(notification.webhookURL, finalData, config);
|
|
|
|
await axios.post(notification.webhookURL, finalData, config);
|
|
|
|
return okMsg;
|
|
|
|
return okMsg;
|
|
|
|
|
|
|
|
|
|
|
|