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