From cc09147b4bbd831fd614ed5c770dc7496d7638f3 Mon Sep 17 00:00:00 2001 From: taschenuhr Date: Wed, 28 Feb 2024 16:31:47 +0100 Subject: [PATCH] fix adding optional ActionSet --- server/notification-providers/teams.js | 20 +++++++++----------- 1 file changed, 9 insertions(+), 11 deletions(-) diff --git a/server/notification-providers/teams.js b/server/notification-providers/teams.js index 4435d2ddb..e46bc9e32 100644 --- a/server/notification-providers/teams.js +++ b/server/notification-providers/teams.js @@ -151,17 +151,15 @@ class Teams extends NotificationProvider { }; if (dashboardUrl) { - payload.attachments.forEach(element => { - element.content.push({ - "type": "ActionSet", - "actions": [ - { - "type": "Action.OpenUrl", - "title": "Visit Uptime Kuma", - "url": dashboardUrl - } - ] - }); + payload.attachments[0].content.body.push({ + "type": "ActionSet", + "actions": [ + { + "type": "Action.OpenUrl", + "title": "Visit Uptime Kuma", + "url": dashboardUrl + } + ] }); }