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

find user by using first args of paginate method

kaori 4 лет назад
Родитель
Сommit
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,