Returning usernames.

This commit is contained in:
David Jay
2016-11-07 16:19:20 -05:00
parent 4737e84681
commit 0e1e04d2a9
3 changed files with 3 additions and 3 deletions
+1
View File
@@ -17,6 +17,7 @@ const CommentSchema = new Schema({
},
asset_id: String,
author_id: String,
username: String,
status: {
type: String,
enum: ['accepted', 'rejected', ''],
+2 -2
View File
@@ -30,7 +30,8 @@ router.post('/', (req, res, next) => {
author_id: req.body.author_id,
asset_id: req.body.asset_id,
parent_id: req.body.parent_id,
status: req.body.status
status: req.body.status,
username: req.body.username
});
comment.save().then(({id}) => {
res.status(200).send(id);
@@ -46,7 +47,6 @@ router.post('/:comment_id', (req, res, next) => {
comment.asset_id = req.body.asset_id;
comment.parent_id = req.body.parent_id;
comment.status = req.body.status;
comment.username = req.body.username;
comment.save().then((comment) => {
res.status(200).send(comment);
-1
View File
@@ -17,7 +17,6 @@ router.get('/', (req, res, next) => {
Action.findByItemIdArray(comments.map((comment) => comment.id))
]);
}).then(([comments, users, actions]) => {
console.log(comments.length);
res.json([...comments,...users,...actions]);
}).catch(error => {
next(error);