mirror of
https://github.com/wassname/talk.git
synced 2026-09-10 12:43:11 +08:00
More tests.
This commit is contained in:
+9
-1
@@ -29,6 +29,14 @@ const AssetSchema = new Schema({
|
||||
type: Schema.Types.Mixed,
|
||||
default: null
|
||||
},
|
||||
closedAt: {
|
||||
type: Date,
|
||||
default: null
|
||||
},
|
||||
closedMessage: {
|
||||
type: String,
|
||||
default: null
|
||||
},
|
||||
title: String,
|
||||
description: String,
|
||||
image: String,
|
||||
@@ -69,7 +77,7 @@ AssetSchema.statics.findById = (id) => Asset.findOne({id});
|
||||
AssetSchema.statics.findByUrl = (url) => Asset.findOne({url});
|
||||
|
||||
AssetSchema.virtual('isClosed').get(function() {
|
||||
return this.settings && this.settings.closedAt && this.settings.closedAt <= new Date().getTime();
|
||||
return this.closedAt && this.closedAt.getTime() <= new Date().getTime();
|
||||
});
|
||||
|
||||
/**
|
||||
|
||||
Reference in New Issue
Block a user