mirror of
https://github.com/wassname/talk.git
synced 2026-09-12 13:01:11 +08:00
Initial working editComment mutation
This commit is contained in:
@@ -51,6 +51,23 @@ const TagSchema = new Schema({
|
||||
_id: false
|
||||
});
|
||||
|
||||
/**
|
||||
* A record of old body values for a Comment
|
||||
*/
|
||||
const BodyHistoryItemSchema = new Schema({
|
||||
body: {
|
||||
required: true,
|
||||
type: String,
|
||||
},
|
||||
|
||||
// datetime until the comment body value was this.body
|
||||
created_at: {
|
||||
required: true,
|
||||
type: Date,
|
||||
default: Date,
|
||||
}
|
||||
});
|
||||
|
||||
/**
|
||||
* The Mongo schema for a Comment.
|
||||
* @type {Schema}
|
||||
@@ -66,6 +83,7 @@ const CommentSchema = new Schema({
|
||||
required: [true, 'The body is required.'],
|
||||
minlength: 2
|
||||
},
|
||||
body_history: [BodyHistoryItemSchema],
|
||||
asset_id: String,
|
||||
author_id: String,
|
||||
status_history: [StatusSchema],
|
||||
|
||||
Reference in New Issue
Block a user