mirror of
https://github.com/koichixD/uptime-kuma.git
synced 2026-09-04 09:13:21 +00:00
chore: enable formatting over the entire codebase in CI (#6655)
Co-authored-by: autofix-ci[bot] <114827586+autofix-ci[bot]@users.noreply.github.com>
This commit is contained in:
co-authored by
autofix-ci[bot]
parent
6658f2ce41
commit
0f61d7ee1b
+9
-28
@@ -207,19 +207,9 @@ class Notification {
|
||||
* @returns {Promise<string>} Successful msg
|
||||
* @throws Error with fail msg
|
||||
*/
|
||||
static async send(
|
||||
notification,
|
||||
msg,
|
||||
monitorJSON = null,
|
||||
heartbeatJSON = null
|
||||
) {
|
||||
static async send(notification, msg, monitorJSON = null, heartbeatJSON = null) {
|
||||
if (this.providerList[notification.type]) {
|
||||
return this.providerList[notification.type].send(
|
||||
notification,
|
||||
msg,
|
||||
monitorJSON,
|
||||
heartbeatJSON
|
||||
);
|
||||
return this.providerList[notification.type].send(notification, msg, monitorJSON, heartbeatJSON);
|
||||
} else {
|
||||
throw new Error("Notification type is not supported");
|
||||
}
|
||||
@@ -236,10 +226,7 @@ class Notification {
|
||||
let bean;
|
||||
|
||||
if (notificationID) {
|
||||
bean = await R.findOne("notification", " id = ? AND user_id = ? ", [
|
||||
notificationID,
|
||||
userID,
|
||||
]);
|
||||
bean = await R.findOne("notification", " id = ? AND user_id = ? ", [notificationID, userID]);
|
||||
|
||||
if (!bean) {
|
||||
throw new Error("notification not found");
|
||||
@@ -268,10 +255,7 @@ class Notification {
|
||||
* @returns {Promise<void>}
|
||||
*/
|
||||
static async delete(notificationID, userID) {
|
||||
let bean = await R.findOne("notification", " id = ? AND user_id = ? ", [
|
||||
notificationID,
|
||||
userID,
|
||||
]);
|
||||
let bean = await R.findOne("notification", " id = ? AND user_id = ? ", [notificationID, userID]);
|
||||
|
||||
if (!bean) {
|
||||
throw new Error("notification not found");
|
||||
@@ -296,16 +280,13 @@ class Notification {
|
||||
* @returns {Promise<void>}
|
||||
*/
|
||||
async function applyNotificationEveryMonitor(notificationID, userID) {
|
||||
let monitors = await R.getAll("SELECT id FROM monitor WHERE user_id = ?", [
|
||||
userID,
|
||||
]);
|
||||
let monitors = await R.getAll("SELECT id FROM monitor WHERE user_id = ?", [userID]);
|
||||
|
||||
for (let i = 0; i < monitors.length; i++) {
|
||||
let checkNotification = await R.findOne(
|
||||
"monitor_notification",
|
||||
" monitor_id = ? AND notification_id = ? ",
|
||||
[ monitors[i].id, notificationID ]
|
||||
);
|
||||
let checkNotification = await R.findOne("monitor_notification", " monitor_id = ? AND notification_id = ? ", [
|
||||
monitors[i].id,
|
||||
notificationID,
|
||||
]);
|
||||
|
||||
if (!checkNotification) {
|
||||
let relation = R.dispense("monitor_notification");
|
||||
|
||||
Reference in New Issue
Block a user