We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent 5b5e48a commit 960a15cCopy full SHA for 960a15c
server/models/Recipient.js
@@ -0,0 +1,9 @@
1
+const mongoose = require('mongoose');
2
+const { Schema } = mongoose;
3
+
4
+const recipientSchema = new Schema({
5
+ email: String,
6
+ responded: { type: Boolean, default: false }
7
+});
8
9
+module.exports = recipientSchema;
server/models/Survey.js
@@ -1,11 +1,12 @@
const mongoose = require('mongoose');
const { Schema } = mongoose;
+const RecipientSchema = require('./Recipient');
const surveySchema = new Schema({
title: String,
body: String,
subject: String,
- recipients: [String],
+ recipients: [RecipientSchema],
10
yes: { type: Number, default: 0 },
11
no: { type: Number, default: 0 }
12
});
0 commit comments