mirror of
https://github.com/louislam/uptime-kuma.git
synced 2024-12-25 16:31:17 -06:00
Apply suggestions from code review
Co-authored-by: Frank Elsinga <frank@elsinga.de>
This commit is contained in:
parent
f3562864ee
commit
6984596568
@ -8,16 +8,9 @@ class PushDeer extends NotificationProvider {
|
|||||||
|
|
||||||
async send(notification, msg, monitorJSON = null, heartbeatJSON = null) {
|
async send(notification, msg, monitorJSON = null, heartbeatJSON = null) {
|
||||||
let okMsg = "Sent Successfully.";
|
let okMsg = "Sent Successfully.";
|
||||||
let defaultServer = "https://api2.pushdeer.com";
|
|
||||||
let endpoint = "/message/push";
|
let endpoint = "/message/push";
|
||||||
let pushdeerlink;
|
let serverUrl = notification.pushdeerServer || "https://api2.pushdeer.com";
|
||||||
if (notification.pushdeerServer) {
|
pushdeerlink = `${serverUrl.trim().replace(/\/*$/, "")}${endpoint}`;
|
||||||
// remove blank characters and ending '/'
|
|
||||||
let customServer = notification.pushdeerServer.trim().replace(/\/*$/, "");
|
|
||||||
pushdeerlink = `${customServer}${endpoint}`;
|
|
||||||
} else {
|
|
||||||
pushdeerlink = `${defaultServer}${endpoint}`;
|
|
||||||
}
|
|
||||||
|
|
||||||
let valid = msg != null && monitorJSON != null && heartbeatJSON != null;
|
let valid = msg != null && monitorJSON != null && heartbeatJSON != null;
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user