#vote @method -rename

This commit is contained in:
Alex
2018-06-23 22:53:22 +03:00
parent 17529d0646
commit 7e27cf5060
2 changed files with 4 additions and 4 deletions
+2 -2
View File
@@ -24,7 +24,7 @@ export const getComment = ({ id }) => fetcher.get(`/id/${id}?url=${url}`);
export const getUserComments = ({ user, limit }) => fetcher.get(`/comments?user=${user}&limit=${limit}`);
export const vote = ({ id, url, value }) => fetcher.put({
export const putCommentVote = ({ id, url, value }) => fetcher.put({
url: `/vote/${id}?url=${url}&vote=${value}`,
withCredentials: true,
});
@@ -112,7 +112,7 @@ export default {
getCommentsCount,
getComment,
getUserComments,
vote,
putCommentVote,
send,
edit,
getUser,
+2 -2
View File
@@ -233,7 +233,7 @@ export default class Comment extends Component {
this.votingPromise = this.votingPromise
.then(() => {
return api.vote({ id, url, value: 1 })
return api.putCommentVote({ id, url, value: 1 })
.then(() => {
api.getComment({ id }).then(comment => store.replaceComment(comment));
});
@@ -254,7 +254,7 @@ export default class Comment extends Component {
this.votingPromise = this.votingPromise
.then(() => {
return api.vote({ id, url, value: -1 })
return api.putCommentVote({ id, url, value: -1 })
.then(() => {
api.getComment({ id }).then(comment => store.replaceComment(comment));
});