|
|
@@ -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;
|
|
|
};
|