diff --git a/web/app/common/api.js b/web/app/common/api.js index 566db403..db80d871 100644 --- a/web/app/common/api.js +++ b/web/app/common/api.js @@ -11,9 +11,9 @@ export const logOut = () => fetcher.get({ url: `/auth/logout`, overriddenApiBase export const getConfig = () => fetcher.get(`/config`); // TODO: looks like we can get url from settings here and below -export const find = ({ sort, url }) => fetcher.get(`/find?url=${url}&sort=${sort}&format=tree`); +export const getPostComments = ({ sort, url }) => fetcher.get(`/find?url=${url}&sort=${sort}&format=tree`); -export const last = ({ siteId, max }) => fetcher.get(`/last/${max}?site=${siteId}`); +export const getLastComments = ({ siteId, max }) => fetcher.get(`/last/${max}?site=${siteId}`); export const counts = ({ urls, siteId }) => fetcher.post({ url: `/counts?site=${siteId}`, @@ -107,7 +107,7 @@ export const getBlocked = () => fetcher.get({ export default { logOut, getConfig, - find, + getPostComments, last, counts, getComment, diff --git a/web/app/components/root/root.jsx b/web/app/components/root/root.jsx index 4ac23048..2428b663 100644 --- a/web/app/components/root/root.jsx +++ b/web/app/components/root/root.jsx @@ -62,7 +62,7 @@ export default class Root extends Component { api.getUser() .then(data => store.set('user', data)) .catch(() => store.set('user', {})), - api.find({ sort, url }) + api.getPostComments({ sort, url }) .then(({ comments = [] } = {}) => store.set('comments', comments)) .catch(() => store.set('comments', [])), ]).finally(() => { @@ -133,7 +133,7 @@ export default class Root extends Component { // if someone was unblocked let's reload comments if (wasSomeoneUnblocked) { - api.find({ sort, url }).then(({ comments } = {}) => store.set('comments', comments)); + api.getPostComments({ sort, url }).then(({ comments } = {}) => store.set('comments', comments)); } this.setState({ @@ -153,7 +153,7 @@ export default class Root extends Component { // can't save; ignore it } - api.find({ sort, url }) + api.getPostComments({ sort, url }) .then(({ comments } = {}) => store.set('comments', comments)) .finally(() => { this.setState({ isCommentsListLoading: false });