|
|
@@ -140,7 +140,7 @@ const schema = new Schema<PageDocument, PageModel>({
|
|
|
commentCount: { type: Number, default: 0 },
|
|
|
expandContentWidth: { type: Boolean },
|
|
|
wip: { type: Boolean },
|
|
|
- wipExpiredAt: { type: Date, index: true },
|
|
|
+ ttlTimestamp: { type: Date, index: true },
|
|
|
updatedAt: { type: Date, default: Date.now }, // Do not use timetamps for updatedAt because it breaks 'updateMetadata: false' option
|
|
|
deleteUser: { type: ObjectId, ref: 'User' },
|
|
|
deletedAt: { type: Date },
|
|
|
@@ -1055,17 +1055,17 @@ schema.methods.calculateAndUpdateLatestRevisionBodyLength = async function(this:
|
|
|
|
|
|
schema.methods.publish = function() {
|
|
|
this.wip = undefined;
|
|
|
- this.wipExpiredAt = undefined;
|
|
|
+ this.ttlTimestamp = undefined;
|
|
|
};
|
|
|
|
|
|
schema.methods.unpublish = function() {
|
|
|
this.wip = true;
|
|
|
- this.wipExpiredAt = undefined;
|
|
|
+ this.ttlTimestamp = undefined;
|
|
|
};
|
|
|
|
|
|
schema.methods.makeWip = function() {
|
|
|
this.wip = true;
|
|
|
- this.wipExpiredAt = new Date();
|
|
|
+ this.ttlTimestamp = new Date();
|
|
|
};
|
|
|
|
|
|
/*
|