From 1c8348d553988f5474c8d7896c2804dc1d62159a Mon Sep 17 00:00:00 2001 From: Raphael Kabo Date: Mon, 25 Apr 2022 19:03:24 +0100 Subject: feat: Add subscribe to group functionality --- models/EventGroup.js | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) (limited to 'models/EventGroup.js') 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); -- cgit v1.2.3