Преглед на файлове

Change path name to save

Shun Miyazawa преди 3 години
родител
ревизия
9df34a0f48
променени са 2 файла, в които са добавени 5 реда и са изтрити 1 реда
  1. 4 0
      packages/app/src/server/models/attachment.js
  2. 1 1
      packages/app/src/server/routes/apiv3/customize-setting.js

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

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

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

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