Kaynağa Gözat

change logic

Shun Miyazawa 3 yıl önce
ebeveyn
işleme
88a9b5732d
1 değiştirilmiş dosya ile 5 ekleme ve 1 silme
  1. 5 1
      packages/app/src/server/service/attachment.js

+ 5 - 1
packages/app/src/server/service/attachment.js

@@ -81,7 +81,11 @@ class AttachmentService {
 
   async isBrandLogoExist() {
     const Attachment = this.crowi.model('Attachment');
-    return await Attachment.findOne({ attachmentType: AttachmentType.BRAND_LOGO }) != null;
+
+    const query = { attachmentType: AttachmentType.BRAND_LOGO };
+    const count = await Attachment.countDocuments(query);
+
+    return count >= 1;
   }
 
 }