no message

This commit is contained in:
2018-03-07 03:16:32 -05:00
parent 1cb920499f
commit 0c7b621753
2 changed files with 15 additions and 14 deletions

View File

@@ -7,10 +7,10 @@ const ProfileSchema = new Mongoose.Schema({
"order" : { type: Number, default: 0 }, "order" : { type: Number, default: 0 },
"details": { "details": {
"about": { type: String }, "about": { type: String },
"age": { type: Number, index: true, defaulrt: 0 }, "age": { type: Number, index: true, default: 0 },
"body": { type: String, enum: ['slim','toned','average','muscular','large'] }, "body": { type: String, enum: ['dns','slim','toned','average','muscular','large','stocky'], default: 'dns' },
"ethnicity": [{ type: String }], "ethnicity": { type: String, enum: ['dns','asian','black','latino','middle eastern','mixed','native american','white','south asian','other'], default: 'dns' },
"gender": { type: String }, "gender": { type: String, enum: ['man','cis man','trans man','woman','cis woman','trans woman','non-binary','non-conforming','queer','crossdresser'], default: 'dns' },
"height": { type: String }, "height": { type: String },
"looking": [{ type: String, enum: ['chat','friends','networking','dates','relationship','right now'] }], "looking": [{ type: String, enum: ['chat','friends','networking','dates','relationship','right now'] }],
"name": { type: String, index: true }, "name": { type: String, index: true },
@@ -18,12 +18,13 @@ const ProfileSchema = new Mongoose.Schema({
"detail": { type: String, default: "profile/default_detail.png" }, "detail": { type: String, default: "profile/default_detail.png" },
"thumb": { type: String, default: "profile/default_thumbnail.png" } "thumb": { type: String, default: "profile/default_thumbnail.png" }
}, },
"position": [{ type: String, enum: ['bottom','vers bottom','versatile','vers top','top','foreplay only'] }], "position": { type: String, enum: ['dns','bottom','vers bottom','versatile','vers top','top'], default: 'dns' },
"pronouns": { type: String }, "pronouns": { type: String },
"weight": { type: Number }, "weight": { type: Number },
"status": [{ type: String, enum: ['unknown','negative','negative, on prep','postive','positive, undetectable'] }], "relationship": { type: String, enum: ['dns','committed','dating','engaged','exclusive','married','open relationship','partnered','single'], default: 'dns' },
"status": { type: String, enum: ['dns','unknown','negative','negative, on prep','postive','positive, undetectable'], default: 'dns' },
"tested": { type: Date }, "tested": { type: Date },
"tribe": [{ type: String, enum: ['twink','geek','otter','bear','daddy','jock'] }] "tribe": [{ type: String, enum: ['twink','trans','poz','leather','geek','discreet','otter','bear','daddy','jock','clean-cut'] }]
}, },
"messages" : [ { type: Messages.schema } ] "messages" : [ { type: Messages.schema } ]
}); });

View File

@@ -327,12 +327,12 @@ Router.route('/:id?')
}) })
.patch( update ) .patch( update )
.post((req, res) => { .post((req, res) => {
Token.verifyThen(req.get('authorization'), 'add', (err, decoded) => { // Token.verifyThen(req.get('authorization'), 'add', (err, decoded) => {
if (err || (decoded && !decoded.hasPermission)) { // if (err || (decoded && !decoded.hasPermission)) {
res.status(403).json({ message: 'User not authorized to perform this action.', err: err }); // res.status(403).json({ message: 'User not authorized to perform this action.', err: err });
return; // return;
} // }
//
if (decoded && decoded.hasPermission) { if (decoded && decoded.hasPermission) {
var ProfileEvents = new EventEmitter(); var ProfileEvents = new EventEmitter();
var profile = Array.isArray(req.body) ? req.body : [ req.body ]; var profile = Array.isArray(req.body) ? req.body : [ req.body ];
@@ -350,7 +350,7 @@ Router.route('/:id?')
Profiles.create(ProfileEvents, profile); Profiles.create(ProfileEvents, profile);
} }
}); // });
}) })
.put( update ); .put( update );