Просмотр исходного кода

success getting one attachment infomation from it's id

kaoritokashiki 5 лет назад
Родитель
Сommit
5856cee94d
1 измененных файлов с 5 добавлено и 3 удалено
  1. 5 3
      src/server/routes/apiv3/attachment.js

+ 5 - 3
src/server/routes/apiv3/attachment.js

@@ -17,13 +17,15 @@ const router = express.Router();
 
 module.exports = (crowi) => {
   const accessTokenParser = require('../../middlewares/access-token-parser')(crowi);
-  const loginRequired = require('../../middlewares/login-required')(crowi);
+  // const loginRequired = require('../../middlewares/login-required')(crowi);
   const Attachment = crowi.model('Attachment');
 
-  router.get('/attachment', accessTokenParser, loginRequired, async(req, res) => {
+  // router.get('/attachment', accessTokenParser, loginRequired, async(req, res) => {
+  router.get('/list', accessTokenParser, async(req, res) => {
+    const id = req.query.id;
+    // const ids = console.log(req.query.id);
 
     try {
-      const id = req.params.id;
       const attachment = await Attachment.findById(id);
       return res.apiv3({ attachment });
     }