diff --git a/web/app/common/api.js b/web/app/common/api.js index 920d4996..3047fc21 100644 --- a/web/app/common/api.js +++ b/web/app/common/api.js @@ -64,7 +64,7 @@ export const getUser = () => fetcher.get({ }); /* admin */ -export const pin = ({ id, url }) => fetcher.put({ +export const pinComment = ({ id, url }) => fetcher.put({ url: `/admin/pin/${id}?url=${url}&pin=1`, withCredentials: true, }); @@ -118,7 +118,7 @@ export default { getUser, getPreview, - pin, + pinComment, unpin, verify, unverify, diff --git a/web/app/components/comment/comment.jsx b/web/app/components/comment/comment.jsx index 72fd8924..6a49335d 100644 --- a/web/app/components/comment/comment.jsx +++ b/web/app/components/comment/comment.jsx @@ -137,7 +137,7 @@ export default class Comment extends Component { if (confirm('Do you want to pin this comment?')) { this.setState({ pinned: true }); - api.pin({ id, url }).then(() => { + api.pinComment({ id, url }).then(() => { api.getComment({ id }).then(comment => store.replaceComment(comment)); }); }