mirror of
https://github.com/wassname/talk.git
synced 2026-09-12 13:01:11 +08:00
Edit UI sends editComment mutation, handles errors
This commit is contained in:
@@ -0,0 +1,7 @@
|
||||
mutation EditComment ($id: ID!, $edit: EditCommentInput) {
|
||||
editComment(id:$id, edit:$edit) {
|
||||
errors {
|
||||
translation_key
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -8,6 +8,7 @@ import ADD_COMMENT_TAG from './addCommentTag.graphql';
|
||||
import REMOVE_COMMENT_TAG from './removeCommentTag.graphql';
|
||||
import IGNORE_USER from './ignoreUser.graphql';
|
||||
import STOP_IGNORING_USER from './stopIgnoringUser.graphql';
|
||||
import EDIT_COMMENT from './editComment.graphql';
|
||||
|
||||
import MY_IGNORED_USERS from '../queries/myIgnoredUsers.graphql';
|
||||
import STREAM_QUERY from '../queries/streamQuery.graphql';
|
||||
@@ -191,3 +192,24 @@ export const stopIgnoringUser = graphql(STOP_IGNORING_USER, {
|
||||
};
|
||||
}
|
||||
});
|
||||
|
||||
export const editComment = graphql(EDIT_COMMENT, {
|
||||
props: ({mutate, ownProps}) => {
|
||||
return {
|
||||
editComment: (id, edit) => {
|
||||
return mutate({
|
||||
variables: {
|
||||
id,
|
||||
edit,
|
||||
},
|
||||
refetchQueries: [
|
||||
{
|
||||
query: STREAM_QUERY,
|
||||
variables: variablesForStreamQuery(ownProps),
|
||||
}
|
||||
]
|
||||
});
|
||||
}
|
||||
};
|
||||
}
|
||||
});
|
||||
|
||||
@@ -23,8 +23,10 @@
|
||||
"comments": "comments",
|
||||
"commentIsIgnored": "This comment is hidden because you ignored this user.",
|
||||
"error": {
|
||||
"editWindowExpired": "You can no longer edit this comment. The time window to do so has expired.",
|
||||
"emailNotVerified": "Email address {0} not verified.",
|
||||
"email": "Not a valid E-Mail",
|
||||
"networkError": "Failed to connect to server. Check your internet connection and try again.",
|
||||
"password": "Password must be at least 8 characters",
|
||||
"username": "Usernames can contain letters, numbers and _ only",
|
||||
"confirmPassword": "Passwords don't match. Please, check again",
|
||||
|
||||
Reference in New Issue
Block a user