diff options
author | Raphael Kabo <mail@raphaelkabo.com> | 2022-04-25 19:03:24 +0100 |
---|---|---|
committer | Raphael Kabo <mail@raphaelkabo.com> | 2022-04-25 19:03:24 +0100 |
commit | 1c8348d553988f5474c8d7896c2804dc1d62159a (patch) | |
tree | 16990fae56e848e430312c2238be89268f937a75 /models | |
parent | 168c2430e1e727429b76871cc32a9951e4391658 (diff) |
feat: Add subscribe to group functionality
Diffstat (limited to 'models')
-rwxr-xr-x | models/EventGroup.js | 10 |
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); |