ryuichi-e пре 5 година
родитељ
комит
88313ab043

+ 3 - 2
src/client/js/components/MyBookmarkList/MyBookmarkList.jsx

@@ -45,9 +45,10 @@ class MyBookmarkList extends React.Component {
     // const offset = (selectPageNumber - 1) * limit;
     // const offset = (selectPageNumber - 1) * limit;
 
 
     try {
     try {
-      const bookmarkList = await this.props.appContainer.apiv3.get('/users', userId);
+      const response = await this.props.appContainer.apiv3.get('/bookmarks/byUser');
+      const pageList = response.data.pageList;
       this.setState({
       this.setState({
-        pages: bookmarkList,
+        pages: pageList,
       });
       });
     }
     }
     catch (error) {
     catch (error) {

+ 3 - 2
src/server/routes/apiv3/bookmarks.js

@@ -105,8 +105,9 @@ module.exports = (crowi) => {
 
 
   // select page from bookmark where userid = userid
   // select page from bookmark where userid = userid
 
 
-  router.get('/byUser', accessTokenParser, loginRequired, csrf, apiV3FormValidator, async(req, res) => {
-    const { userId } = req.query;
+  router.get('/byUser', /* accessTokenParser, loginRequired, csrf, */ apiV3FormValidator, async(req, res) => {
+    // const { userId } = req.query;
+    const userId = '5f17d27f98265502ea209ea9';
     try {
     try {
       const bookmarks = await Bookmark
       const bookmarks = await Bookmark
         .find({ user: userId })
         .find({ user: userId })