diff --git a/web/app/common/api.js b/web/app/common/api.js index ec09e7bf..920d4996 100644 --- a/web/app/common/api.js +++ b/web/app/common/api.js @@ -42,7 +42,7 @@ export const addComment = ({ text, pid }) => fetcher.post({ withCredentials: true, }); -export const edit = ({ text, id }) => fetcher.put({ +export const updateComment = ({ text, id }) => fetcher.put({ url: `/comment/${id}?url=${url}`, body: { text, @@ -114,7 +114,7 @@ export default { getUserComments, putCommentVote, addComment, - edit, + updateComment, getUser, getPreview, diff --git a/web/app/components/input/input.jsx b/web/app/components/input/input.jsx index fd0f7c96..7486ebaf 100644 --- a/web/app/components/input/input.jsx +++ b/web/app/components/input/input.jsx @@ -93,7 +93,7 @@ export default class Input extends Component { this.setState({ isDisabled: true, isErrorShown: false }); const request = mods.mode === 'edit' - ? api.edit({ text, id }) + ? api.updateComment({ text, id }) : api.addComment({ text, ...(pid ? { pid } : {}) }); request