Kaynağa Gözat

find user by using first args of paginate method

kaori 4 yıl önce
ebeveyn
işleme
6218041c03

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

@@ -71,10 +71,9 @@ export default class InAppNotificationService {
   }
   }
 
 
   getLatestNotificationsByUser = async(userId, limitNum, offset) => {
   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 },
         sort: { createdAt: -1 },
         offset,
         offset,