no message

This commit is contained in:
2018-03-04 16:12:44 -05:00
parent 687db7dda8
commit 08fb835a64
3 changed files with 27 additions and 18 deletions

View File

@@ -1,6 +1,4 @@
const Mongoose = require('mongoose'); module.exports = {
const DetailSchema = new Mongoose.Schema({
"about": { type: String }, "about": { type: String },
"age": { type: Number, index: true }, "age": { type: Number, index: true },
"body": { type: String }, "body": { type: String },
@@ -19,11 +17,4 @@ const DetailSchema = new Mongoose.Schema({
"status": { type: String }, "status": { type: String },
"tested": { type: Date }, "tested": { type: Date },
"tribe": { type: String } "tribe": { type: String }
});
const DetailModel = Mongoose.model('details', DetailSchema);
module.exports = {
schema: DetailSchema,
model: DetailModel
}; };

View File

@@ -1,5 +1,4 @@
const fs = require('fs'); const fs = require('fs');
const Details = require('../models/detail');
const Messages = require('../models/message'); const Messages = require('../models/message');
const Mongoose = require('mongoose'); const Mongoose = require('mongoose');
const ShortId = require('shortid'); const ShortId = require('shortid');
@@ -12,7 +11,26 @@ const ATTACHMENT_SUFFIX_THUMBNAIL = '_thumbnail';
const ProfileSchema = new Mongoose.Schema({ const ProfileSchema = new Mongoose.Schema({
"order" : { type: Number, default: 0 }, "order" : { type: Number, default: 0 },
"details": { type: Details.schema }, "details": {
"about": { type: String },
"age": { type: Number, index: true, default: 0 },
"body": { type: String },
"ethnicity": { type: String },
"gender": { type: String },
"height": { type: String },
"looking": { type: String },
"name": { type: String, index: true },
"pic": {
"detail": { type: String, default: "profile/default_detail.png" },
"thumb": { type: String, default: "profile/default_thumbnail.png" }
},
"position": { type: String },
"pronouns": { type: String },
"weight": { type: Number },
"status": { type: String },
"tested": { type: Date },
"tribe": { type: String }
},
"messages" : [ { type: Messages.schema } ] "messages" : [ { type: Messages.schema } ]
}); });

View File

@@ -206,11 +206,11 @@ Router.route('/:profileId?/messages/:messageId?')
Router.route('/:id?') Router.route('/:id?')
.delete( (req, res) => { .delete( (req, res) => {
Token.verifyThen(req.get('authorization'), 'delete', (err, decoded) => { // Token.verifyThen(req.get('authorization'), 'delete', (err, decoded) => {
if (err) { // if (err) {
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;
} // }
var ProfileEvents = new EventEmitter(); var ProfileEvents = new EventEmitter();
var id = req.params.id; var id = req.params.id;
@@ -226,7 +226,7 @@ Router.route('/:id?')
}); });
Profiles.delete(ProfileEvents, id); Profiles.delete(ProfileEvents, id);
}); // });
}) })
.get( (req, res) => { .get( (req, res) => {
// Token.verifyThen(req.get('authorization'), 'view', (err, decoded) => { // Token.verifyThen(req.get('authorization'), 'view', (err, decoded) => {