Răsfoiți Sursa

rename a field

yusuketk 6 ani în urmă
părinte
comite
5ef2fc4d41
1 a modificat fișierele cu 4 adăugiri și 4 ștergeri
  1. 4 4
      src/server/models/user.js

+ 4 - 4
src/server/models/user.js

@@ -17,7 +17,7 @@ module.exports = function(crowi) {
   const STATUS_DELETED = 4;
   const STATUS_INVITED = 5;
   const USER_PUBLIC_FIELDS = '_id image isEmailPublished isGravatarEnabled googleId name username email introduction'
-  + 'status lang createdAt lastLoginAt admin imageAttachmentPathCache';
+  + 'status lang createdAt lastLoginAt admin imagePathCache';
   const IMAGE_POPULATION = { path: 'imageAttachment', select: 'filePathProxied' };
 
   const LANG_EN = 'en';
@@ -39,7 +39,7 @@ module.exports = function(crowi) {
     userId: String,
     image: String,
     imageAttachment: { type: ObjectId, ref: 'Attachment' },
-    imageAttachmentPathCache: String,
+    imagePathCache: String,
     isGravatarEnabled: { type: Boolean, default: false },
     isEmailPublished: { type: Boolean, default: true },
     googleId: String,
@@ -227,7 +227,7 @@ module.exports = function(crowi) {
 
   userSchema.methods.updateImage = async function(attachment) {
     this.imageAttachment = attachment;
-    this.imageAttachmentPathCache = attachment.filePathProxied;
+    this.imagePathCache = attachment.filePath;
     return this.save();
   };
 
@@ -243,7 +243,7 @@ module.exports = function(crowi) {
     }
 
     this.imageAttachment = undefined;
-    this.imageAttachmentPathCache = undefined;
+    this.imagePathCache = undefined;
     return this.save();
   };