Sfoglia il codice sorgente

fix: DeleteAttachmentModal

Yuki Takei 7 anni fa
parent
commit
baecec9da9

+ 1 - 1
src/client/js/components/PageAttachment/DeleteAttachmentModal.js

@@ -25,7 +25,7 @@ export default class DeleteAttachmentModal extends React.Component {
 
   renderByFileFormat(attachment) {
     const content = (attachment.fileFormat.match(/image\/.+/i))
-      ? <img src={attachment.url} />
+      ? <img src={attachment.filePathProxied} />
       : '';
 
 

+ 1 - 1
src/server/routes/attachment.js

@@ -163,7 +163,7 @@ module.exports = function(crowi, app) {
 
     let attachments = await Attachment.find({page: id})
       .sort({'updatedAt': 1})
-      .populate('creator', User.USER_PUBLIC_FIELDS);
+      .populate({ path: 'creator', select: User.USER_PUBLIC_FIELDS, populate: User.IMAGE_POPULATION });
 
     attachments = attachments.map(attachment => attachment.toObject({ virtuals: true }));