diff --git a/web/app/common/api.js b/web/app/common/api.js index dc74374b..93683572 100644 --- a/web/app/common/api.js +++ b/web/app/common/api.js @@ -15,7 +15,7 @@ export const getPostComments = ({ sort, url }) => fetcher.get(`/find?url=${url}& export const getLastComments = ({ siteId, max }) => fetcher.get(`/last/${max}?site=${siteId}`); -export const counts = ({ urls, siteId }) => fetcher.post({ +export const getCommentsCount = ({ urls, siteId }) => fetcher.post({ url: `/counts?site=${siteId}`, body: urls, }); @@ -109,7 +109,7 @@ export default { getConfig, getPostComments, getLastComments, - counts, + getCommentsCount, getComment, getUserComments, vote, diff --git a/web/app/counter.js b/web/app/counter.js index 2c850233..3d0dd7df 100644 --- a/web/app/counter.js +++ b/web/app/counter.js @@ -33,7 +33,7 @@ function init() { return acc; }, {}); - api.counts({ urls: Object.keys(map), siteId: remark_config.site_id }) + api.getCommentsCount({ urls: Object.keys(map), siteId: remark_config.site_id }) .then(res => { res.forEach(item => (map[item.url].innerHTML = item.count)); });