Tags should be an array

This commit is contained in:
gaba
2017-02-08 09:03:21 -08:00
parent fc880de9bf
commit 075e62581e
2 changed files with 12 additions and 10 deletions
+5 -9
View File
@@ -9,11 +9,6 @@ const STATUSES = [
null
];
const TAGS = [
'STAFF',
null
];
/**
* The Mongo schema for a Comment Status.
* @type {Schema}
@@ -54,10 +49,11 @@ const CommentSchema = new Schema({
author_id: String,
status_history: [StatusSchema],
status: {type: String, default: null},
tag: {
type: String,
enum: TAGS,
},
tags: [{
name: String,
assigned_by: String,
created_at: Date
}],
parent_id: String
}, {
timestamps: {
+7 -1
View File
@@ -36,7 +36,13 @@ module.exports = class CommentsService {
created_at: new Date()
}] : [],
status,
tag: UsersService.isStaff(author_id) ? 'STAFF' : null,
tags: [
{
name: UsersService.isStaff(author_id) ? 'STAFF' : null,
assigned_by: null,
created_at: new Date()
}
],
author_id
});