Shun Miyazawa 4 лет назад
Родитель
Сommit
370ca49360

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

@@ -18,7 +18,7 @@ export interface ActivityDocument extends Document {
   _id: Types.ObjectId
   _id: Types.ObjectId
   user: Types.ObjectId | any
   user: Types.ObjectId | any
   targetModel: string
   targetModel: string
-  target: string
+  target: Types.ObjectId
   action: string
   action: string
   event: Types.ObjectId
   event: Types.ObjectId
   eventModel: string
   eventModel: string
@@ -63,7 +63,7 @@ const activitySchema = new Schema<ActivityDocument, ActivityModel>({
   },
   },
   createdAt: {
   createdAt: {
     type: Date,
     type: Date,
-    default: Date.now,
+    default: new Date(),
   },
   },
 });
 });
 activitySchema.index({ target: 1, action: 1 });
 activitySchema.index({ target: 1, action: 1 });

+ 1 - 1
packages/app/src/server/models/in-app-notification.ts

@@ -72,7 +72,7 @@ const inAppNotificationSchema = new Schema<InAppNotificationDocument, InAppNotif
   },
   },
   createdAt: {
   createdAt: {
     type: Date,
     type: Date,
-    default: Date.now,
+    default: new Date(),
   },
   },
   snapshot: {
   snapshot: {
     type: String,
     type: String,

+ 1 - 1
packages/app/src/server/models/subscription.ts

@@ -52,7 +52,7 @@ const subscriptionSchema = new Schema<SubscriptionDocument, SubscriptionModel>({
     require: true,
     require: true,
     enum: STATUSES,
     enum: STATUSES,
   },
   },
-  createdAt: { type: Date, default: Date.now },
+  createdAt: { type: Date, default: new Date() },
 });
 });
 
 
 subscriptionSchema.methods.isSubscribing = function() {
 subscriptionSchema.methods.isSubscribing = function() {