Added enum check for the user model

This commit is contained in:
Dan Zajdband
2016-11-14 16:44:21 -05:00
parent 223887616d
commit 9c41adf224
+4 -1
View File
@@ -24,7 +24,10 @@ const UserSchema = new mongoose.Schema({
required: true
}
}],
roles: [String]
roles: {
type: [{ type: String, enum: ['admin', 'moderator'] }],
}
}, {
timestamps: {
createdAt: 'created_at',