Shun Miyazawa 3 лет назад
Родитель
Сommit
d729c0a58f
2 измененных файлов с 7 добавлено и 1 удалено
  1. 6 0
      packages/app/src/server/routes/attachment.js
  2. 1 1
      packages/app/src/server/routes/index.js

+ 6 - 0
packages/app/src/server/routes/attachment.js

@@ -296,6 +296,12 @@ module.exports = function(crowi, app) {
     return responseForAttachment(req, res, attachment);
     return responseForAttachment(req, res, attachment);
   };
   };
 
 
+  api.getBrandLogo = async function(req, res) {
+    const attachment = await Attachment.findOne({ attachmentType: AttachmentType.BRAND_LOGO });
+
+    return responseForAttachment(req, res, attachment);
+  };
+
   /**
   /**
    * @api {get} /attachments.obsoletedGetForMongoDB get attachments from mongoDB
    * @api {get} /attachments.obsoletedGetForMongoDB get attachments from mongoDB
    * @apiName get
    * @apiName get

+ 1 - 1
packages/app/src/server/routes/index.js

@@ -107,7 +107,7 @@ module.exports = function(crowi, app) {
   app.post('/_api/admin/import/qiita'           , loginRequiredStrictly , adminRequired , csrfProtection, addActivity, admin.api.importDataFromQiita);
   app.post('/_api/admin/import/qiita'           , loginRequiredStrictly , adminRequired , csrfProtection, addActivity, admin.api.importDataFromQiita);
   app.post('/_api/admin/import/testQiitaAPI'    , loginRequiredStrictly , adminRequired , csrfProtection, addActivity, admin.api.testQiitaAPI);
   app.post('/_api/admin/import/testQiitaAPI'    , loginRequiredStrictly , adminRequired , csrfProtection, addActivity, admin.api.testQiitaAPI);
 
 
-  app.get('/attachment/brand-logo/:id([0-9a-z]{24})' , certifyBrandLogo, loginRequired, attachment.api.get);
+  app.get('/attachment/brand-logo' , certifyBrandLogo, loginRequired, attachment.api.getBrandLogo);
 
 
   /*
   /*
    * Routes below are unavailable when maintenance mode
    * Routes below are unavailable when maintenance mode