mirror of
https://github.com/wassname/talk.git
synced 2026-09-12 13:01:11 +08:00
Merge branch 'master' into sory-139595043-qbox
This commit is contained in:
@@ -18,7 +18,7 @@ const getCountsByAssetID = (context, asset_ids) => {
|
||||
$in: asset_ids
|
||||
},
|
||||
status: {
|
||||
$in: [null, 'ACCEPTED']
|
||||
$in: ['NONE', 'ACCEPTED']
|
||||
},
|
||||
parent_id: null
|
||||
}
|
||||
@@ -51,7 +51,7 @@ const getCountsByParentID = (context, parent_ids) => {
|
||||
$in: parent_ids
|
||||
},
|
||||
status: {
|
||||
$in: [null, 'ACCEPTED']
|
||||
$in: ['NONE', 'ACCEPTED']
|
||||
}
|
||||
}
|
||||
},
|
||||
@@ -88,7 +88,7 @@ const getCommentsByQuery = ({user}, {ids, statuses, asset_id, parent_id, author_
|
||||
} else {
|
||||
comments = comments.where({
|
||||
status: {
|
||||
$in: [null, 'ACCEPTED']
|
||||
$in: ['NONE', 'ACCEPTED']
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
@@ -11,10 +11,10 @@ const Wordlist = require('../../services/wordlist');
|
||||
* @param {String} body body of the comment
|
||||
* @param {String} asset_id asset for the comment
|
||||
* @param {String} parent_id optional parent of the comment
|
||||
* @param {String} [status=null] the status of the new comment
|
||||
* @param {String} [status='NONE'] the status of the new comment
|
||||
* @return {Promise} resolves to the created comment
|
||||
*/
|
||||
const createComment = ({user, loaders: {Comments}}, {body, asset_id, parent_id = null}, status = null) => {
|
||||
const createComment = ({user, loaders: {Comments}}, {body, asset_id, parent_id = null}, status = 'NONE') => {
|
||||
return CommentsService.publicCreate({
|
||||
body,
|
||||
asset_id,
|
||||
@@ -105,7 +105,7 @@ const resolveNewCommentStatus = (context, {asset_id, body}, wordlist = {}) => {
|
||||
if (charCountEnable && body.length > charCount) {
|
||||
return 'REJECTED';
|
||||
}
|
||||
return moderation === 'PRE' ? 'PREMOD' : null;
|
||||
return moderation === 'PRE' ? 'PREMOD' : 'NONE';
|
||||
});
|
||||
}
|
||||
|
||||
|
||||
@@ -67,6 +67,10 @@ type Tag {
|
||||
# The statuses that a comment may have.
|
||||
enum COMMENT_STATUS {
|
||||
|
||||
# The comment is not PREMOD, but was not applied a moderation status by a
|
||||
# moderator.
|
||||
NONE
|
||||
|
||||
# The comment has been accepted by a moderator.
|
||||
ACCEPTED
|
||||
|
||||
@@ -93,7 +97,7 @@ enum ACTION_TYPE {
|
||||
input CommentsQuery {
|
||||
|
||||
# current status of a comment.
|
||||
statuses: [COMMENT_STATUS]
|
||||
statuses: [COMMENT_STATUS!]
|
||||
|
||||
# asset that a comment is on.
|
||||
asset_id: ID
|
||||
@@ -152,7 +156,7 @@ type Comment {
|
||||
asset: Asset
|
||||
|
||||
# The current status of a comment.
|
||||
status: COMMENT_STATUS
|
||||
status: COMMENT_STATUS!
|
||||
|
||||
# The time when the comment was created
|
||||
created_at: Date!
|
||||
|
||||
Reference in New Issue
Block a user