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

Merge pull request #6011 from weseek/feat/fix-the-way-to-define-default-value-for-mongoose-schema-types

change the way to define default value
Haku Mizuki 3 лет назад
Родитель
Сommit
da637fefee
1 измененных файлов с 1 добавлено и 1 удалено
  1. 1 1
      packages/app/src/server/models/page-operation.ts

+ 1 - 1
packages/app/src/server/models/page-operation.ts

@@ -106,7 +106,7 @@ const schema = new Schema<PageOperationDocument, PageOperationModel>({
   user: { type: userSchemaForResuming, required: true },
   user: { type: userSchemaForResuming, required: true },
   options: { type: optionsSchemaForResuming },
   options: { type: optionsSchemaForResuming },
   incForUpdatingDescendantCount: { type: Number },
   incForUpdatingDescendantCount: { type: Number },
-  unprocessableExpiryDate: { type: Date, default: addSeconds(new Date(), 10) },
+  unprocessableExpiryDate: { type: Date, default: () => addSeconds(new Date(), 10) },
 });
 });
 
 
 schema.statics.findByIdAndUpdatePageActionStage = async function(
 schema.statics.findByIdAndUpdatePageActionStage = async function(