소스 검색

find user by using first args of paginate method

kaori 4 년 전
부모
커밋
6218041c03
1개의 변경된 파일2개의 추가작업 그리고 3개의 파일을 삭제
  1. 2 3
      packages/app/src/server/service/in-app-notification.ts

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

@@ -71,10 +71,9 @@ export default class InAppNotificationService {
   }
 
   getLatestNotificationsByUser = async(userId, limitNum, offset) => {
-    // InAppNotification.findLatestInAppNotificationsByUser(userId, requestLimit, offset);
 
-    // const notificatins = await InAppNotification.find({ user: userId });
-    const paginatedInAppNotificationResult = await InAppNotification.find({ user: userId }).paginate({},
+    const paginatedInAppNotificationResult = await InAppNotification.paginate(
+      { user: userId },
       {
         sort: { createdAt: -1 },
         offset,