Skip to content
Snippets Groups Projects
Commit a0a55804 authored by Lucas Gabriel Lima's avatar Lucas Gabriel Lima
Browse files

add validators to model

parent b71b2fce
No related branches found
No related tags found
2 merge requests!116Release v1.0.0,!30Auth
Pipeline #
......@@ -8,48 +8,48 @@ const Schema = mongoose.Schema;
var UserSchema = new Schema({
email: {
type: String,
unique: true,
required: true
unique: true,
required: [true, 'O campo Email é obrigatório.']
},
password: {
type: String,
required: true
required: [true, 'O campo Senha é obrigatório.']
},
name: {
type: String,
required: true
required: [true, 'O campo Nome é obrigatório.']
},
cpf:{
type: String,
unique: true,
required: true
unique: [true, 'O CPF informado já está cadastrado.'],
required: [true, 'O campo CPF é obrigatório.']
},
schooling: {
type: String,
required: true
required: [true, 'O campo Escolaridade é obrigatório.']
},
course: {
type: String,
},
segment: {
type: String,
required: true
required: [true, 'O campo Segmento é obrigatório.']
},
role: {
type: String,
required: true
required: [true, 'O campo Função é obrigatório.']
},
institution_name: {
type: String,
required: true
required: [true, 'O campo Instituição em que trabalha é obrigatório.']
},
state: {
type: String,
required: true
required: [true, 'O campo Estado é obrigatório.']
},
city: {
type: String,
required: true
required: [true, 'O campo Cidade é obrigatório.']
},
receive_emails: {
type: Boolean
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment