diff --git a/web/app/components/input/input.jsx b/web/app/components/input/input.jsx index fac558c7..acbf1068 100644 --- a/web/app/components/input/input.jsx +++ b/web/app/components/input/input.jsx @@ -85,9 +85,9 @@ export default class Input extends Component { if (mods.mode === 'edit') { api.edit({ text, id }) - .then(() => { + .then(comment => { if (this.props.onSubmit) { - this.props.onSubmit({ id }); + this.props.onSubmit(comment); } this.fieldNode.value = ''; diff --git a/web/app/components/root/root.jsx b/web/app/components/root/root.jsx index a049e4ec..0bcd3859 100644 --- a/web/app/components/root/root.jsx +++ b/web/app/components/root/root.jsx @@ -167,11 +167,9 @@ export default class Root extends Component { }); } - editComment(data) { - api.getComment({ id: data.id }).then(comment => { - store.replaceComment(comment); - this.setState({ comments: store.get('comments') }); - }); + editComment(comment) { + store.replaceComment(comment); + this.setState({ comments: store.get('comments') }); } render({}, { config = {}, comments = [], user, sort, isLoaded, isBlockedVisible, isCommentsListLoading, bannedUsers }) {