From 0171fc85b54e00563b68f513c39ed422ebd9b247 Mon Sep 17 00:00:00 2001 From: Alex Date: Sat, 23 Jun 2018 22:57:46 +0300 Subject: [PATCH] #edit @method -rename --- web/app/common/api.js | 4 ++-- web/app/components/input/input.jsx | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) 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