错误:在邮件请求发送邮件后无法设置邮件头,为什么?

时间:2015-06-04 10:45:45

标签: node.js express mongoose

每当我从架构中添加验证并尝试发布请求时,我都会收到以下错误消息:

  

错误:发送后无法设置标头。

var PlayerSchema   = new Schema({
    firstName:  { type: String, require: true, required: 'First Name is required' },
    lastName:   { type: String, require: true, required: 'Last Name is required' },
    nickName:   { type: String, trim: true },
    mentor:     { type: String, trim: true },
    clubName:   { type: String, trim: true },
    created_at: { type: Date, default: Date.now },
    updated_at: { type: Date, default: Date.now },

    email: {
        type:   String,
        trim:   true,
        unique: true,
        required: 'Email address is required',
        validate: [validateEmail, 'Please fill a valid email address'],
        match: [/^\w+([\.-]?\w+)*@\w+([\.-]?\w+)*(\.\w{2,3})+$/, 'Please fill a valid email address']
    },
    phoneNumber: { 
      type:     String, 
      unique:   true, 
      required: 'Phone Number is required',

    }
});

0 个答案:

没有答案