Przeglądaj źródła

fix GetAdditionalTargetUsers

Yuki Takei 1 rok temu
rodzic
commit
cc25a4e6a3
1 zmienionych plików z 3 dodań i 4 usunięć
  1. 3 4
      apps/app/src/server/service/pre-notify.ts

+ 3 - 4
apps/app/src/server/service/pre-notify.ts

@@ -11,9 +11,8 @@ export type PreNotifyProps = {
 }
 }
 
 
 export type PreNotify = (props: PreNotifyProps) => Promise<void>;
 export type PreNotify = (props: PreNotifyProps) => Promise<void>;
-export type GeneratePreNotify = (activity: ActivityDocument, getAdditionalTargetUsers?: (activity?: ActivityDocument) => Ref<IUser>[]) => PreNotify;
-
-export type GetAdditionalTargetUsers = (activity: ActivityDocument) => Ref<IUser>[];
+export type GetAdditionalTargetUsers = (activity: ActivityDocument) => Promise<Ref<IUser>[]>;
+export type GeneratePreNotify = (activity: ActivityDocument, getAdditionalTargetUsers?: GetAdditionalTargetUsers) => PreNotify;
 
 
 interface IPreNotifyService {
 interface IPreNotifyService {
   generateInitialPreNotifyProps: (PreNotifyProps) => { notificationTargetUsers?: Ref<IUser>[] },
   generateInitialPreNotifyProps: (PreNotifyProps) => { notificationTargetUsers?: Ref<IUser>[] },
@@ -48,7 +47,7 @@ class PreNotifyService implements IPreNotifyService {
         notificationTargetUsers?.push(...activeNotificationUsers);
         notificationTargetUsers?.push(...activeNotificationUsers);
       }
       }
       else {
       else {
-        const AdditionalTargetUsers = getAdditionalTargetUsers(activity);
+        const AdditionalTargetUsers = await getAdditionalTargetUsers(activity);
 
 
         notificationTargetUsers?.push(
         notificationTargetUsers?.push(
           ...activeNotificationUsers,
           ...activeNotificationUsers,