Skip to content

Commit

Permalink
fix: slack rich notification not working correctly (louislam#5209)
Browse files Browse the repository at this point in the history
  • Loading branch information
CommanderStorm authored Oct 16, 2024
1 parent 42e7779 commit ed6087e
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions server/notification-providers/slack.js
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@ class Slack extends NotificationProvider {
* @param {object} monitorJSON The monitor config
* @returns {Array} The relevant action objects
*/
static buildActions(baseURL, monitorJSON) {
buildActions(baseURL, monitorJSON) {
const actions = [];

if (baseURL) {
Expand Down Expand Up @@ -73,7 +73,7 @@ class Slack extends NotificationProvider {
* @param {string} msg The message body
* @returns {Array<object>} The rich content blocks for the Slack message
*/
static buildBlocks(baseURL, monitorJSON, heartbeatJSON, title, msg) {
buildBlocks(baseURL, monitorJSON, heartbeatJSON, title, msg) {

//create an array to dynamically add blocks
const blocks = [];
Expand Down Expand Up @@ -150,7 +150,7 @@ class Slack extends NotificationProvider {
data.attachments.push(
{
"color": (heartbeatJSON["status"] === UP) ? "#2eb886" : "#e01e5a",
"blocks": Slack.buildBlocks(baseURL, monitorJSON, heartbeatJSON, title, msg),
"blocks": this.buildBlocks(baseURL, monitorJSON, heartbeatJSON, title, msg),
}
);
} else {
Expand Down

0 comments on commit ed6087e

Please sign in to comment.