|
@@ -103,6 +103,23 @@ module.exports = (crowi) => {
|
|
|
}
|
|
}
|
|
|
});
|
|
});
|
|
|
|
|
|
|
|
|
|
+ // select page from bookmark where userid = userid
|
|
|
|
|
+
|
|
|
|
|
+ router.get('/users', accessTokenParser, loginRequired, csrf, apiV3FormValidator, async(req, res) => {
|
|
|
|
|
+ const { userId } = req.body;
|
|
|
|
|
+ const { Bookmark } = crowi.models;
|
|
|
|
|
+ try {
|
|
|
|
|
+ const bookmark = await Bookmark
|
|
|
|
|
+ .find({ user: userId })
|
|
|
|
|
+ .populate({ path: 'page', model: 'Page' });
|
|
|
|
|
+ return res.apiv3({ bookmark });
|
|
|
|
|
+ }
|
|
|
|
|
+ catch (err) {
|
|
|
|
|
+ logger.error('get-bookmark-failed', err);
|
|
|
|
|
+ return res.apiv3Err(err, 500);
|
|
|
|
|
+ }
|
|
|
|
|
+ });
|
|
|
|
|
+
|
|
|
|
|
|
|
|
/**
|
|
/**
|
|
|
* @swagger
|
|
* @swagger
|