From b57a97dec162d9830f3c9fb5e9c404cb9c4b832d Mon Sep 17 00:00:00 2001
From: Tobias Feldmann <t.feldmann@adito.de>
Date: Fri, 25 Sep 2020 14:25:28 +0200
Subject: [PATCH] notification state changes with bulk update

---
 .../setnotificationstate/children/archive/onActionProcess.js | 5 +----
 .../setnotificationstate/children/setnew/onActionProcess.js  | 5 +----
 .../setnotificationstate/children/setread/onActionProcess.js | 5 +----
 3 files changed, 3 insertions(+), 12 deletions(-)

diff --git a/entity/Notification_entity/entityfields/setnotificationstate/children/archive/onActionProcess.js b/entity/Notification_entity/entityfields/setnotificationstate/children/archive/onActionProcess.js
index a11db05fbf..054975d09d 100644
--- a/entity/Notification_entity/entityfields/setnotificationstate/children/archive/onActionProcess.js
+++ b/entity/Notification_entity/entityfields/setnotificationstate/children/archive/onActionProcess.js
@@ -5,8 +5,5 @@ import("system.neon");
 
 var user = tools.getCurrentUser();
 var selectedNotifications = vars.get("$sys.selection");
-
-for(var i = 0; i < selectedNotifications.length; i++)
-    notification.updateUserNotificationState(user["name"], selectedNotifications[i], notification.STATE_ARCHIVE);
-
+notification.updateUserNotificationsState(user["name"], selectedNotifications, notification.STATE_ARCHIVE);
 neon.refreshAll();
\ No newline at end of file
diff --git a/entity/Notification_entity/entityfields/setnotificationstate/children/setnew/onActionProcess.js b/entity/Notification_entity/entityfields/setnotificationstate/children/setnew/onActionProcess.js
index 3010398e4c..2695978b29 100644
--- a/entity/Notification_entity/entityfields/setnotificationstate/children/setnew/onActionProcess.js
+++ b/entity/Notification_entity/entityfields/setnotificationstate/children/setnew/onActionProcess.js
@@ -5,8 +5,5 @@ import("system.neon");
 
 var user = tools.getCurrentUser();
 var selectedNotifications = vars.get("$sys.selection");
-
-for(var i = 0; i < selectedNotifications.length; i++)
-    notification.updateUserNotificationState(user["name"], selectedNotifications[i], notification.STATE_UNSEEN);
-
+notification.updateUserNotificationsState(user["name"], selectedNotifications, notification.STATE_UNSEEN);
 neon.refreshAll();
\ No newline at end of file
diff --git a/entity/Notification_entity/entityfields/setnotificationstate/children/setread/onActionProcess.js b/entity/Notification_entity/entityfields/setnotificationstate/children/setread/onActionProcess.js
index 3e00593f26..33bd6bf461 100644
--- a/entity/Notification_entity/entityfields/setnotificationstate/children/setread/onActionProcess.js
+++ b/entity/Notification_entity/entityfields/setnotificationstate/children/setread/onActionProcess.js
@@ -7,8 +7,5 @@ import("KeywordRegistry_basic");
 
 var user = tools.getCurrentUser();
 var selectedNotifications = vars.get("$sys.selection");
-
-for(var i = 0; i < selectedNotifications.length; i++)
-    notification.updateUserNotificationState(user["name"], selectedNotifications[i], notification.STATE_CONFIRMED);
-
+notification.updateUserNotificationsState(user["name"], selectedNotifications, notification.STATE_CONFIRMED);
 neon.refreshAll();
\ No newline at end of file
-- 
GitLab