Shun Miyazawa 3 лет назад
Родитель
Сommit
88a9b5732d
1 измененных файлов с 5 добавлено и 1 удалено
  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;
   }
 
 }