From 13c655344a47b9b81a00a4bd17d764fc8f267344 Mon Sep 17 00:00:00 2001
From: Denis Bykhov <bykhov.denis@gmail.com>
Date: Wed, 31 May 2023 17:44:14 +0600
Subject: [PATCH] UBER-314 (#3301)

Signed-off-by: Denis Bykhov <bykhov.denis@gmail.com>
---
 models/request/src/index.ts                        | 7 ++++---
 server-plugins/notification-resources/src/index.ts | 5 ++++-
 2 files changed, 8 insertions(+), 4 deletions(-)

diff --git a/models/request/src/index.ts b/models/request/src/index.ts
index beb85544b0..81442953ad 100644
--- a/models/request/src/index.ts
+++ b/models/request/src/index.ts
@@ -120,10 +120,11 @@ export function createModel (builder: Builder): void {
     {
       hidden: false,
       objectClass: request.class.Request,
-      txClasses: [core.class.TxCreateDoc],
+      txClasses: [core.class.TxCreateDoc, core.class.TxUpdateDoc],
+      field: 'requested',
       generated: false,
       group: request.ids.RequestNotificationGroup,
-      label: request.string.Requested,
+      label: request.string.Request,
       allowedForAuthor: true,
       providers: {
         [notification.providers.PlatformNotification]: true
@@ -136,7 +137,7 @@ export function createModel (builder: Builder): void {
     builder,
     request.class.Request,
     request.ids.RequestNotificationGroup,
-    [],
+    ['requested'],
     ['comments', 'approved', 'rejected', 'status']
   )
 
diff --git a/server-plugins/notification-resources/src/index.ts b/server-plugins/notification-resources/src/index.ts
index 3567640f87..5b7e594f24 100644
--- a/server-plugins/notification-resources/src/index.ts
+++ b/server-plugins/notification-resources/src/index.ts
@@ -688,7 +688,10 @@ async function getNewCollaborators (
   if (ops.$push !== undefined) {
     for (const key in ops.$push) {
       if (mixin.fields.includes(key)) {
-        const value = (ops.$push as any)[key]
+        let value = (ops.$push as any)[key]
+        if (typeof value !== 'string') {
+          value = value.$each
+        }
         const newCollabs = await getKeyCollaborators(doc, value, key, control)
         if (newCollabs !== undefined) {
           for (const newCollab of newCollabs) {