Email field
parent
c98c3d0e44
commit
4cb06a5324
|
@ -9,6 +9,9 @@ const NoteSchema = new Schema({
|
|||
text: {
|
||||
type: String, required: [true, "can't be blank"],
|
||||
},
|
||||
user: {
|
||||
type: Schema.Types.ObjectId, ref: 'User',
|
||||
},
|
||||
}, { timestamps: true });
|
||||
|
||||
module.exports = NoteSchema;
|
||||
|
|
|
@ -9,8 +9,8 @@ const UserSchema = new Schema({
|
|||
lastname: {
|
||||
type: String, required: [true, "can't be blank"],
|
||||
},
|
||||
username: {
|
||||
type: String, lowercase: true, unique: true, required: [true, "can't be blank"], match: [/^[a-zA-Z0-9]+$/, 'is invalid'], index: true,
|
||||
email: {
|
||||
type: String, lowercase: true, unique: true, required: [true, "can't be blank"], index: true,
|
||||
},
|
||||
password: {
|
||||
type: String, required: [true, "can't be blank"],
|
||||
|
|
Loading…
Reference in New Issue