From 2e54dee817f02953393be0167ce71128dbfe8fac Mon Sep 17 00:00:00 2001 From: Matthew Nickson Date: Sat, 1 Oct 2022 15:03:28 +0100 Subject: [PATCH] Fixed Octopush Notifier not working #2144 The version number was passed as a string from the frontend but was checked against a number in the backend provider. This caused the if else if to fall through into an error. The literal it is now being compared has been changed to a string and the unknown version error is no longer encountered. Signed-off-by: Matthew Nickson --- server/notification-providers/octopush.js | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/server/notification-providers/octopush.js b/server/notification-providers/octopush.js index 0eda940b..524a4a88 100644 --- a/server/notification-providers/octopush.js +++ b/server/notification-providers/octopush.js @@ -10,7 +10,7 @@ class Octopush extends NotificationProvider { try { // Default - V2 - if (notification.octopushVersion === 2 || !notification.octopushVersion) { + if (notification.octopushVersion === "2" || !notification.octopushVersion) { let config = { headers: { "api-key": notification.octopushAPIKey, @@ -31,7 +31,7 @@ class Octopush extends NotificationProvider { "sender": notification.octopushSenderName }; await axios.post("https://api.octopush.com/v1/public/sms-campaign/send", data, config); - } else if (notification.octopushVersion === 1) { + } else if (notification.octopushVersion === "1") { let data = { "user_login": notification.octopushDMLogin, "api_key": notification.octopushDMAPIKey,