Browse Source

remove User type

kaori 4 years ago
parent
commit
c6adec1f83
1 changed files with 2 additions and 3 deletions
  1. 2 3
      packages/app/src/server/models/in-app-notification.ts

+ 2 - 3
packages/app/src/server/models/in-app-notification.ts

@@ -8,7 +8,6 @@ import loggerFactory from '../../utils/logger';
 import { Activity, ActivityDocument } from '~/server/models/activity';
 import { Activity, ActivityDocument } from '~/server/models/activity';
 
 
 const logger = loggerFactory('growi:models:inAppNotification');
 const logger = loggerFactory('growi:models:inAppNotification');
-const User = getModelSafely('User') || require('~/server/models/user')();
 
 
 const STATUS_UNREAD = 'UNREAD';
 const STATUS_UNREAD = 'UNREAD';
 const STATUS_UNOPENED = 'UNOPENED';
 const STATUS_UNOPENED = 'UNOPENED';
@@ -31,9 +30,9 @@ export interface InAppNotificationModel extends Model<InAppNotificationDocument>
   upsertByActivity(user: Types.ObjectId, activity: ActivityDocument, createdAt?: Date | null): Promise<InAppNotificationDocument | null>
   upsertByActivity(user: Types.ObjectId, activity: ActivityDocument, createdAt?: Date | null): Promise<InAppNotificationDocument | null>
   // commented out type 'Query' temporary to avoid ts error
   // commented out type 'Query' temporary to avoid ts error
   removeEmpty()/* : Query<any> */
   removeEmpty()/* : Query<any> */
-  read(user: typeof User) /* : Promise<Query<any>> */
+  read(user) /* : Promise<Query<any>> */
 
 
-  open(user: typeof User, id: Types.ObjectId): Promise<InAppNotificationDocument | null>
+  open(user, id: Types.ObjectId): Promise<InAppNotificationDocument | null>
   getUnreadCountByUser(user: Types.ObjectId): Promise<number | undefined>
   getUnreadCountByUser(user: Types.ObjectId): Promise<number | undefined>
 
 
   STATUS_UNREAD: string
   STATUS_UNREAD: string