@@ -18,7 +18,7 @@ export interface ActivityDocument extends Document {
_id: Types.ObjectId
user: Types.ObjectId | any
targetModel: string
- target: string
+ target: Types.ObjectId
action: string
event: Types.ObjectId
eventModel: string
@@ -63,7 +63,7 @@ const activitySchema = new Schema<ActivityDocument, ActivityModel>({
},
createdAt: {
type: Date,
- default: Date.now,
+ default: new Date(),
});
activitySchema.index({ target: 1, action: 1 });
@@ -72,7 +72,7 @@ const inAppNotificationSchema = new Schema<InAppNotificationDocument, InAppNotif
snapshot: {
type: String,
@@ -52,7 +52,7 @@ const subscriptionSchema = new Schema<SubscriptionDocument, SubscriptionModel>({
require: true,
enum: STATUSES,
- createdAt: { type: Date, default: Date.now },
+ createdAt: { type: Date, default: new Date() },
subscriptionSchema.methods.isSubscribing = function() {