Shun Miyazawa 4 лет назад
Родитель
Сommit
5968db47ed
1 измененных файлов с 16 добавлено и 0 удалено
  1. 16 0
      packages/app/src/server/routes/apiv3/page.js

+ 16 - 0
packages/app/src/server/routes/apiv3/page.js

@@ -463,5 +463,21 @@ module.exports = (crowi) => {
   //   return res.apiv3({ dummy });
   // });
 
+  router.put('/subscribe', accessTokenParser, loginRequiredStrictly, csrf, async(req, res) => {
+    console.log('ok');
+    return res.apiv3({});
+    // const { page_id: pageId } = req.body
+    // const { _id: userId } = req.user as UserDocument
+    // const status = req.body.status ? Watcher.STATUS_WATCH : Watcher.STATUS_IGNORE
+    // try {
+    //   const watcher = await Watcher.watchByPageId(userId, pageId, status)
+    //   const result = { watcher }
+    //   return res.json(ApiResponse.success(result))
+    // } catch (err) {
+    //   debug('Error occured while update watch status', err, err.stack)
+    //   return res.json(ApiResponse.error('Failed to watch this page.'))
+    // }
+  });
+
   return router;
 };