Skip to content

Commit

Permalink
Add validation
Browse files Browse the repository at this point in the history
  • Loading branch information
getogrand committed Apr 16, 2017
1 parent fa9067c commit 034f044
Showing 1 changed file with 12 additions and 3 deletions.
15 changes: 12 additions & 3 deletions models/mail.js
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,10 @@ const mongoose = require('mongoose')
const Schema = mongoose.Schema

const addressSchema = new Schema({
address: String,
address: {
type: String,
required: true,
},
name: String,
})

Expand All @@ -14,8 +17,14 @@ const mailTransform = (doc, ret, options) => {
}

const mailSchema = new Schema({
subject: String,
recipient: String,
subject: {
type: String,
required: true,
},
recipient: {
type: String,
required: true,
},
secretCode: String,
to: [addressSchema],
from: [addressSchema],
Expand Down

0 comments on commit 034f044

Please sign in to comment.