summaryrefslogtreecommitdiff
path: root/models/EventGroup.js
diff options
context:
space:
mode:
authorRaphael Kabo <mail@raphaelkabo.com>2022-04-25 19:03:24 +0100
committerRaphael Kabo <mail@raphaelkabo.com>2022-04-25 19:03:24 +0100
commit1c8348d553988f5474c8d7896c2804dc1d62159a (patch)
tree16990fae56e848e430312c2238be89268f937a75 /models/EventGroup.js
parent168c2430e1e727429b76871cc32a9951e4391658 (diff)
feat: Add subscribe to group functionality
Diffstat (limited to 'models/EventGroup.js')
-rwxr-xr-xmodels/EventGroup.js10
1 files changed, 9 insertions, 1 deletions
diff --git a/models/EventGroup.js b/models/EventGroup.js
index 6d2893b..c70ef95 100755
--- a/models/EventGroup.js
+++ b/models/EventGroup.js
@@ -1,5 +1,12 @@
const mongoose = require('mongoose');
+const Subscriber = new mongoose.Schema({
+ email: {
+ type: String,
+ trim: true
+ },
+})
+
const EventGroupSchema = new mongoose.Schema({
id: {
type: String,
@@ -43,7 +50,8 @@ const EventGroupSchema = new mongoose.Schema({
trim: true,
default: true
},
- events: [{ type: mongoose.Schema.Types.ObjectId, ref: 'Event' }]
+ events: [{ type: mongoose.Schema.Types.ObjectId, ref: 'Event' }],
+ subscribers: [Subscriber],
});
module.exports = mongoose.model('EventGroup', EventGroupSchema);