Просмотр исходного кода

Merge pull request #4976 from weseek/fix/84410-error-that-activity-is-not-saved

fix: 84410 error that activity is not saved
Yuki Takei 4 лет назад
Родитель
Сommit
451e81eeb1
1 измененных файлов с 2 добавлено и 5 удалено
  1. 2 5
      packages/app/src/server/models/activity.ts

+ 2 - 5
packages/app/src/server/models/activity.ts

@@ -22,7 +22,6 @@ export interface ActivityDocument extends Document {
   action: string
   action: string
   event: Types.ObjectId
   event: Types.ObjectId
   eventModel: string
   eventModel: string
-  createdAt: Date
 
 
   getNotificationTargetUsers(): Promise<any[]>
   getNotificationTargetUsers(): Promise<any[]>
 }
 }
@@ -61,10 +60,8 @@ const activitySchema = new Schema<ActivityDocument, ActivityModel>({
     type: String,
     type: String,
     enum: ActivityDefine.getSupportEventModelNames(),
     enum: ActivityDefine.getSupportEventModelNames(),
   },
   },
-  createdAt: {
-    type: Date,
-    default: new Date(),
-  },
+}, {
+  timestamps: true,
 });
 });
 activitySchema.index({ target: 1, action: 1 });
 activitySchema.index({ target: 1, action: 1 });
 activitySchema.index({
 activitySchema.index({