mirror of
https://github.com/wassname/talk.git
synced 2026-09-12 13:01:11 +08:00
Adds privacy type to the methods to add tags.
This commit is contained in:
@@ -28,7 +28,7 @@ const createComment = ({user, loaders: {Comments}}, {body, asset_id, parent_id =
|
||||
.then(async (comment) => {
|
||||
|
||||
if (user.hasRoles('ADMIN') || user.hasRoles('MODERATOR')) {
|
||||
await CommentsService.addTag(comment.id, 'STAFF', user.id);
|
||||
await CommentsService.addTag(comment.id, 'STAFF', user.id, 'PUBLIC');
|
||||
}
|
||||
|
||||
// If the loaders are present, clear the caches for these values because we
|
||||
@@ -202,8 +202,8 @@ const setCommentStatus = ({loaders: {Comments}}, {id, status}) => {
|
||||
* @param {String} id identifier of the comment (uuid)
|
||||
* @param {String} tag name of the tag
|
||||
*/
|
||||
const addCommentTag = ({user, loaders: {Comments}}, {id, tag}) => {
|
||||
return CommentsService.addTag(id, tag, user.id);
|
||||
const addCommentTag = ({user, loaders: {Comments}}, {id, tag, privacy_type}) => {
|
||||
return CommentsService.addTag(id, tag, user.id, privacy_type);
|
||||
};
|
||||
|
||||
/**
|
||||
|
||||
@@ -32,8 +32,8 @@ const RootMutation = {
|
||||
setCommentStatus(_, {id, status}, {mutators: {Comment}}) {
|
||||
return wrapResponse(null)(Comment.setCommentStatus({id, status}));
|
||||
},
|
||||
addCommentTag(_, {id, tag}, {mutators: {Comment}}) {
|
||||
return wrapResponse('comment')(Comment.addCommentTag({id, tag}).then(() => CommentsService.findById(id)));
|
||||
addCommentTag(_, {id, tag, privacy_type}, {mutators: {Comment}}) {
|
||||
return wrapResponse('comment')(Comment.addCommentTag({id, tag, privacy_type}).then(() => CommentsService.findById(id)));
|
||||
},
|
||||
removeCommentTag(_, {id, tag}, {mutators: {Comment}}) {
|
||||
return wrapResponse('comment')(Comment.removeCommentTag({id, tag}).then(() => CommentsService.findById(id)));
|
||||
|
||||
@@ -808,7 +808,7 @@ type RootMutation {
|
||||
setCommentStatus(id: ID!, status: COMMENT_STATUS!): SetCommentStatusResponse
|
||||
|
||||
# Add tag to comment.
|
||||
addCommentTag(id: ID!, tag: String!): AddCommentTagResponse
|
||||
addCommentTag(id: ID!, tag: String!, privacy_type: String!): AddCommentTagResponse
|
||||
|
||||
# Remove tag from comment.
|
||||
removeCommentTag(id: ID!, tag: String!): RemoveCommentTagResponse
|
||||
|
||||
Reference in New Issue
Block a user