Skip to content

Commit

Permalink
Merge pull request #208 from tyler-furby/patch-1
Browse files Browse the repository at this point in the history
Add forms for profile social accounts and about section
  • Loading branch information
jasonify authored Apr 27, 2018
2 parents 8e9c136 + cf4e493 commit 1d6e27c
Show file tree
Hide file tree
Showing 2 changed files with 22 additions and 2 deletions.
7 changes: 6 additions & 1 deletion config/param-validation.js
Original file line number Diff line number Diff line change
Expand Up @@ -7,9 +7,14 @@ export default {
username: Joi.string().required(),
name: Joi.string().required(),
bio: Joi.string().allow(''),
about: Joi.string().allow(''),
github: Joi.string().allow(''),
linkedin: Joi.string().allow(''),
twitter: Joi.string().allow(''),
website: Joi.string().allow(''),
isAvatarSet: Joi.boolean().required(),
email: Joi.string().email().allow('')
email: Joi.string().email().allow(''),
publicEmail: Joi.string().email().allow('')
},
params: {
userId: Joi.string().hex().required()
Expand Down
17 changes: 16 additions & 1 deletion server/models/user.model.js
Original file line number Diff line number Diff line change
Expand Up @@ -34,9 +34,21 @@ const UserSchema = new mongoose.Schema({
bio: {
type: String
},
about: {
type: String
},
website: {
type: String
},
linkedin: {
type: String
},
twitter: {
type: String
},
github: {
type: String
},
verified: {
type: Boolean,
default: false
Expand All @@ -48,6 +60,9 @@ const UserSchema = new mongoose.Schema({
email: {
type: String
},
publicEmail: {
type: String
},
facebook: {
id: {
type: String
Expand Down Expand Up @@ -151,7 +166,7 @@ UserSchema.statics = {
isValidHash: function validPassword({ original, hash }) {
return bcrypt.compareSync(original, hash);
},
updatableFields: ['username', 'website', 'bio', 'name', 'email']
updatableFields: ['username', 'website', 'bio', 'publicEmail', 'twitter', 'github', 'linkedin', 'about', 'name', 'email']
};

/**
Expand Down

0 comments on commit 1d6e27c

Please sign in to comment.