mirror of
https://github.com/wassname/talk.git
synced 2026-07-12 21:07:19 +08:00
Tags should be an array
This commit is contained in:
+5
-9
@@ -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: {
|
||||
|
||||
@@ -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
|
||||
});
|
||||
|
||||
|
||||
Reference in New Issue
Block a user