ソースを参照

added a todo comment

kaori 4 年 前
コミット
fc2aaf2d84
1 ファイル変更32 行追加2 行削除
  1. 32 2
      packages/app/src/server/service/in-app-notification.ts

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

@@ -86,9 +86,39 @@ export default class InAppNotificationService {
           ],
         },
       );
+    }
+    catch (err) {
+      throw new Error(err);
+    }
 
-      console.log('pagenatedInAppNotifications', pagenatedInAppNotifications);
-      return pagenatedInAppNotifications;
+    try {
+      /**
+       * TODO: return results including notifications,hasPrev and hasNext by #78991
+       * refer to https://github.com/crowi/crowi/blob/eecf2bc821098d2516b58104fe88fae81497d3ea/lib/controllers/notification.ts
+       */
+      // Notification.findLatestNotificationsByUser(user._id, requestLimit, offset)
+      // .then(function (notifications) {
+      //   let hasPrev = false
+      //   if (offset > 0) {
+      //     hasPrev = true
+      //   }
+
+      //   let hasNext = false
+      //   if (notifications.length > limit) {
+      //     hasNext = true
+      //   }
+
+      //   const result = {
+      //     notifications: notifications.slice(0, limit),
+      //     hasPrev: hasPrev,
+      //     hasNext: hasNext,
+      //   }
+
+      //   return res.json(ApiResponse.success(result))
+      // })
+      // .catch(function (err) {
+      //   return res.json(ApiResponse.error(err))
+      // })
 
     }
     catch (err) {