diff options
author | lowercasename <raphaelkabo@gmail.com> | 2019-10-01 00:32:31 +0100 |
---|---|---|
committer | lowercasename <raphaelkabo@gmail.com> | 2019-10-01 00:32:31 +0100 |
commit | 0c46e2d2d148efb7cfabcf82c12266a8d788f551 (patch) | |
tree | b1a2b9f5aa4dfa543a965b1d7886f4f133d63a54 /models/Event.js | |
parent | f04431e5b29b86b7439e41d40ae5a23a13ddd488 (diff) | |
parent | 40ade71e0019bbb59710a2e2e5d74197c47cb1b0 (diff) |
Merge branch 'master' of https://github.com/lowercasename/gathio
Diffstat (limited to 'models/Event.js')
-rwxr-xr-x | models/Event.js | 81 |
1 files changed, 41 insertions, 40 deletions
diff --git a/models/Event.js b/models/Event.js index 43af171..3c0bb8c 100755 --- a/models/Event.js +++ b/models/Event.js @@ -19,7 +19,7 @@ const ReplySchema = new mongoose.Schema({ id: { type: String, required: true, - unique: true, + unique: true, sparse: true }, author: { @@ -43,7 +43,7 @@ const CommentSchema = new mongoose.Schema({ id: { type: String, required: true, - unique: true, + unique: true, sparse: true }, author: { @@ -68,37 +68,37 @@ const EventSchema = new mongoose.Schema({ id: { type: String, required: true, - unique: true + unique: true }, type: { - type: String, - trim: true, + type: String, + trim: true, required: true - }, - name: { - type: String, - trim: true, + }, + name: { + type: String, + trim: true, required: true - }, - location: { - type: String, - trim: true, + }, + location: { + type: String, + trim: true, required: true - }, + }, start: { // Stored as a UTC timestamp - type: Date, - trim: true, + type: Date, + trim: true, required: true - }, + }, end: { // Stored as a UTC timestamp - type: Date, - trim: true, + type: Date, + trim: true, required: true - }, - timezone: { + }, + timezone: { type: String, default: 'Etc/UTC' - }, + }, description: { type: String, trim: true, @@ -121,34 +121,35 @@ const EventSchema = new mongoose.Schema({ trim: true }, viewPassword: { - type: String, - trim: true - }, + type: String, + trim: true + }, editPassword: { - type: String, - trim: true - }, + type: String, + trim: true + }, editToken: { - type: String, - trim: true, + type: String, + trim: true, minlength: 32, maxlength: 32 - }, + }, + eventGroup: { type: mongoose.Schema.Types.ObjectId, ref: 'EventGroup' }, usersCanAttend: { - type: Boolean, - trim: true, + type: Boolean, + trim: true, default: false - }, + }, showUsersList: { - type: Boolean, - trim: true, + type: Boolean, + trim: true, default: false - }, + }, usersCanComment: { - type: Boolean, - trim: true, + type: Boolean, + trim: true, default: false - }, + }, firstLoad: { type: Boolean, trim: true, |