From 7e27cf5060cf1e864bf5588e156bda4ef50319c4 Mon Sep 17 00:00:00 2001 From: Alex Date: Sat, 23 Jun 2018 22:53:22 +0300 Subject: [PATCH] #vote @method -rename --- web/app/common/api.js | 4 ++-- web/app/components/comment/comment.jsx | 4 ++-- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/web/app/common/api.js b/web/app/common/api.js index 93683572..f8afcbbb 100644 --- a/web/app/common/api.js +++ b/web/app/common/api.js @@ -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, diff --git a/web/app/components/comment/comment.jsx b/web/app/components/comment/comment.jsx index 02870a14..72fd8924 100644 --- a/web/app/components/comment/comment.jsx +++ b/web/app/components/comment/comment.jsx @@ -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)); });