|
|
@@ -103,6 +103,22 @@ module.exports = (crowi) => {
|
|
|
}
|
|
|
});
|
|
|
|
|
|
+ // select page from bookmark where userid = userid
|
|
|
+
|
|
|
+ router.get('/userId', /* accessTokenParser, loginRequired, csrf, */ apiV3FormValidator, async(req, res) => {
|
|
|
+ const { userId } = req.query;
|
|
|
+ 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
|