mirror of
https://github.com/wassname/talk.git
synced 2026-08-05 13:30:26 +08:00
editComment returns status of comment after edit. UI shows appropriate notifications if PREMOD or REJECTED
This commit is contained in:
@@ -259,6 +259,7 @@ const editComment = async ({user, loaders: {Comments}}, {id, edit}) => {
|
||||
throw error;
|
||||
}
|
||||
}
|
||||
return {status};
|
||||
};
|
||||
|
||||
module.exports = (context) => {
|
||||
|
||||
@@ -6,7 +6,7 @@ const RootMutation = {
|
||||
return wrapResponse('comment')(Comment.create(comment));
|
||||
},
|
||||
editComment(_, args, {mutators: {Comment}}) {
|
||||
return wrapResponse(null)(Comment.editComment(args));
|
||||
return wrapResponse('comment')(Comment.editComment(args));
|
||||
},
|
||||
createLike(_, {like: {item_id, item_type}}, {mutators: {Action}}) {
|
||||
return wrapResponse('like')(Action.create({item_id, item_type, action_type: 'LIKE'}));
|
||||
|
||||
@@ -794,7 +794,13 @@ input EditCommentInput {
|
||||
body: String!
|
||||
}
|
||||
|
||||
type CommentInfoAfterEdit {
|
||||
# New status of the edited comment
|
||||
status: COMMENT_STATUS!
|
||||
}
|
||||
|
||||
type EditCommentResponse implements Response {
|
||||
comment: CommentInfoAfterEdit!
|
||||
# An array of errors relating to the mutation that occured.
|
||||
errors: [UserError]
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user