yusuketk 7 лет назад
Родитель
Сommit
b9a0b7f7e6
1 измененных файлов с 4 добавлено и 5 удалено
  1. 4 5
      src/server/routes/tag.js

+ 4 - 5
src/server/routes/tag.js

@@ -1,5 +1,4 @@
 module.exports = function(crowi, app) {
-  'use strict';
 
   const Tag = crowi.model('Tag');
   const PageTagRelation = crowi.model('PageTagRelation');
@@ -19,8 +18,8 @@ module.exports = function(crowi, app) {
    */
   api.search = async function(req, res) {
     let tags = await Tag.find({}).select('-_id name');
-    tags = tags.map(tag => tag.name);
-    return res.json(ApiResponse.success({tags}));
+    tags = tags.map((tag) => { return tag.name });
+    return res.json(ApiResponse.success({ tags }));
   };
 
   /**
@@ -32,8 +31,8 @@ module.exports = function(crowi, app) {
    */
   api.get = async function(req, res) {
     let tags = await PageTagRelation.find({relatedPage: req.query.pageId}).populate('relatedTag').select('-_id relatedTag');
-    tags = tags.map(tag => tag.relatedTag.name);
-    return res.json(ApiResponse.success({tags}));
+    tags = tags.map((tag) => { return tag.relatedTag.name });
+    return res.json(ApiResponse.success({ tags }));
   };
 
   return actions;