#edit @method -rename

This commit is contained in:
Alex
2018-06-23 22:57:46 +03:00
parent 48bcadbceb
commit 0171fc85b5
2 changed files with 3 additions and 3 deletions
+2 -2
View File
@@ -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,
+1 -1
View File
@@ -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