From f557045fb104fe98885d23bc8debf696aae83500 Mon Sep 17 00:00:00 2001 From: Nayem Siddique Date: Sun, 13 Jul 2025 20:00:47 +0600 Subject: [PATCH] fix linting issues --- server/notification-providers/linenotify.js | 16 ++++++++-------- 1 file changed, 8 insertions(+), 8 deletions(-) diff --git a/server/notification-providers/linenotify.js b/server/notification-providers/linenotify.js index f817e761a..3918dc59e 100644 --- a/server/notification-providers/linenotify.js +++ b/server/notification-providers/linenotify.js @@ -1,6 +1,5 @@ const NotificationProvider = require("./notification-provider"); const axios = require("axios"); -const qs = require("qs"); const { DOWN, UP } = require("../../src/util"); class LineNotify extends NotificationProvider { @@ -14,15 +13,16 @@ class LineNotify extends NotificationProvider { const url = "https://api.line.me/v2/bot/message/broadcast"; try { - let config = { + const config = { headers: { "Content-Type": "application/json", Authorization: "Bearer " + notification.lineNotifyAccessToken, }, }; - if (heartbeatJSON == null) { - let testMessage = { + + if (!heartbeatJSON) { + const testMessage = { messages: [ { type: "text", @@ -32,12 +32,12 @@ class LineNotify extends NotificationProvider { }; await axios.post(url, testMessage, config); } else if (heartbeatJSON["status"] === DOWN) { - let downMessage = { + const downMessage = { messages: [ { type: "text", text: - `🔴 [Down]\n` + + "🔴 [Down]\n" + `Name: ${monitorJSON["name"]}\n` + `${heartbeatJSON["msg"]}\n` + `Time (${heartbeatJSON["timezone"]}): ${heartbeatJSON["localDateTime"]}`, @@ -46,12 +46,12 @@ class LineNotify extends NotificationProvider { }; await axios.post(url, downMessage, config); } else if (heartbeatJSON["status"] === UP) { - let upMessage = { + const upMessage = { messages: [ { type: "text", text: - `✅ [Up]\n` + + "✅ [Up]\n" + `Name: ${monitorJSON["name"]}\n` + `${heartbeatJSON["msg"]}\n` + `Time (${heartbeatJSON["timezone"]}): ${heartbeatJSON["localDateTime"]}`,