Просмотр исходного кода

Merge pull request #9434 from weseek/fix/notification-for-new-user-creation

fix: Notification for new user creation
mergify[bot] 1 год назад
Родитель
Сommit
0c32e88e6b
1 измененных файлов с 6 добавлено и 1 удалено
  1. 6 1
      apps/app/src/server/routes/login.js

+ 6 - 1
apps/app/src/server/routes/login.js

@@ -50,10 +50,15 @@ module.exports = function(crowi, app) {
       targetModel: SupportedTargetModel.MODEL_USER,
     });
 
+    /**
+     * @param {import('../service/pre-notify').PreNotifyProps} props
+     */
     const preNotify = async(props) => {
+      /** @type {(import('mongoose').HydratedDocument<import('@growi/core').IUser>)[]} */
       const adminUsers = await User.findAdmins();
 
-      props.push(...adminUsers);
+      const { notificationTargetUsers } = props;
+      notificationTargetUsers?.push(...adminUsers);
     };
 
     await activityEvent.emit('updated', activity, user, preNotify);