@@ -3,8 +3,9 @@ export const generateCertifyBrandLogoMiddleware = (crowi) => {
return async(req, res, next) => {
const { attachmentService } = crowi;
+ const isBrandLogoExist = await attachmentService.isBrandLogoExist();
- if (attachmentService.isBrandLogoExist()) {
+ if (isBrandLogoExist) {
req.isBrandLogo = true;
}
@@ -79,9 +79,9 @@ class AttachmentService {
return;
- isBrandLogoExist() {
+ async isBrandLogoExist() {
const Attachment = this.crowi.model('Attachment');
- return Attachment.findOne({ attachmentType: AttachmentType.BRAND_LOGO }) != null;
+ return await Attachment.findOne({ attachmentType: AttachmentType.BRAND_LOGO }) != null;