#edit @method -rename
This commit is contained in:
@@ -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,
|
||||
|
||||
|
||||
@@ -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
|
||||
|
||||
Reference in New Issue
Block a user