From 971373beed9338efa4a48b871cb5f9a9d2b78c21 Mon Sep 17 00:00:00 2001 From: Frank Elsinga Date: Sat, 20 Apr 2024 01:16:17 +0200 Subject: [PATCH] Made sure that the notification provider is not different from the other notification providers --- server/notification-providers/sevenio.js | 11 +++++------ src/components/notifications/SevenIO.vue | 11 ++++++++++- 2 files changed, 15 insertions(+), 7 deletions(-) diff --git a/server/notification-providers/sevenio.js b/server/notification-providers/sevenio.js index 8f816fce..d363e95d 100644 --- a/server/notification-providers/sevenio.js +++ b/server/notification-providers/sevenio.js @@ -1,9 +1,8 @@ const NotificationProvider = require("./notification-provider"); -const Axios = require("axios"); +const axios = require("axios"); const { DOWN, UP } = require("../../src/util"); class SevenIO extends NotificationProvider { - name = "SevenIO"; /** @@ -18,18 +17,18 @@ class SevenIO extends NotificationProvider { text: msg, }; - const axios = Axios.create({ + const config = { baseURL: "https://gateway.seven.io/api/", headers: { "Content-Type": "application/json", "X-API-Key": notification.sevenioApiKey, }, - }); + }; try { // testing or certificate expiry notification if (heartbeatJSON == null) { - await axios.post("sms", data); + await axios.post("sms", data, config); return okMsg; } @@ -67,7 +66,7 @@ class SevenIO extends NotificationProvider { data.text = `Your service ${monitorJSON["name"]} ${address}went back up at ${heartbeatJSON["localDateTime"]} ` + `(${heartbeatJSON["timezone"]}).`; } - await axios.post("sms", data); + await axios.post("sms", data, config); return okMsg; } catch (error) { this.throwGeneralAxiosError(error); diff --git a/src/components/notifications/SevenIO.vue b/src/components/notifications/SevenIO.vue index b2b1676b..fcf746ec 100644 --- a/src/components/notifications/SevenIO.vue +++ b/src/components/notifications/SevenIO.vue @@ -1,7 +1,7 @@ + +