Skip to content

Commit 316b3ab

Browse files
committed
feat(users): Add new fields
1 parent ca75166 commit 316b3ab

2 files changed

Lines changed: 10 additions & 1 deletion

File tree

server/src/users/models/user.model.js

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,8 +11,11 @@ const toUpperCase = value => value.toUpperCase();
1111

1212
const userSchema = new mongoose.Schema({
1313
firstName: String,
14-
email: { type: String, index: true, unique: true },
1514
lastName: { type: String, get: toUpperCase, set: toUpperCase },
15+
email: { type: String, index: true, unique: true },
16+
tags: [String],
17+
phone: String,
18+
job: String,
1619
profilePictureUrl: { type: String, default: defaultProfilePictureUrl },
1720
password: String,
1821
roles: [String],

server/src/users/routes/user-validation.js

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -30,6 +30,9 @@ exports.payload = {
3030
githubHandle: Joi.string(),
3131
trelloHandle: Joi.string(),
3232
city: Joi.string().valid(validCities).required(),
33+
phone: Joi.string(),
34+
job: Joi.string(),
35+
tags: Joi.array().items(Joi.string()),
3336
profilePictureUrl: Joi.string().uri().allow(null),
3437
}),
3538
put: Joi.object().keys({
@@ -40,6 +43,9 @@ exports.payload = {
4043
githubHandle: Joi.string(),
4144
trelloHandle: Joi.string(),
4245
city: Joi.string().valid(validCities),
46+
phone: Joi.string(),
47+
job: Joi.string(),
48+
tags: Joi.array().items(Joi.string()),
4349
profilePictureUrl: Joi.string().uri().allow(null),
4450
}),
4551
};

0 commit comments

Comments
 (0)