Shun Miyazawa 3 лет назад
Родитель
Сommit
75c6e9a2ff

+ 2 - 1
packages/app/src/server/middlewares/certify-brand-logo.ts

@@ -3,8 +3,9 @@ export const generateCertifyBrandLogoMiddleware = (crowi) => {
   return async(req, res, next) => {
   return async(req, res, next) => {
 
 
     const { attachmentService } = crowi;
     const { attachmentService } = crowi;
+    const isBrandLogoExist = await attachmentService.isBrandLogoExist();
 
 
-    if (attachmentService.isBrandLogoExist()) {
+    if (isBrandLogoExist) {
       req.isBrandLogo = true;
       req.isBrandLogo = true;
     }
     }
 
 

+ 2 - 2
packages/app/src/server/service/attachment.js

@@ -79,9 +79,9 @@ class AttachmentService {
     return;
     return;
   }
   }
 
 
-  isBrandLogoExist() {
+  async isBrandLogoExist() {
     const Attachment = this.crowi.model('Attachment');
     const Attachment = this.crowi.model('Attachment');
-    return Attachment.findOne({ attachmentType: AttachmentType.BRAND_LOGO }) != null;
+    return await Attachment.findOne({ attachmentType: AttachmentType.BRAND_LOGO }) != null;
   }
   }
 
 
 }
 }