Browse Source

Change path name to save

Shun Miyazawa 3 năm trước cách đây
mục cha
commit
9df34a0f48

+ 4 - 0
packages/app/src/server/models/attachment.js

@@ -51,6 +51,10 @@ module.exports = function(crowi) {
     return `/attachment/${this._id}`;
   });
 
+  attachmentSchema.virtual('brandLogoFilePathProxied').get(function() {
+    return `/attachment/brand-logo/${this._id}`;
+  });
+
   attachmentSchema.virtual('downloadPathProxied').get(function() {
     return `/download/${this._id}`;
   });

+ 1 - 1
packages/app/src/server/routes/apiv3/customize-setting.js

@@ -718,7 +718,7 @@ module.exports = (crowi) => {
       try {
         attachment = await attachmentService.createAttachment(file, req.user, null, AttachmentType.BRAND_LOGO);
         const attachmentConfigParams = {
-          'customize:customizedLogoSrc': attachment.filePathProxied,
+          'customize:customizedLogoSrc': attachment.brandLogoFilePathProxied,
         };
 
         await crowi.configManager.updateConfigsInTheSameNamespace('crowi', attachmentConfigParams);