From 338724121f254c50cbfa96b17bffe16fac8d81ab Mon Sep 17 00:00:00 2001 From: igoradamenko Date: Sun, 11 Mar 2018 21:54:17 +0300 Subject: [PATCH] change /count endpoint to /counts --- web/app/common/api.js | 6 +++--- web/app/counter.js | 2 +- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/web/app/common/api.js b/web/app/common/api.js index 46cdb174..24b47fe4 100644 --- a/web/app/common/api.js +++ b/web/app/common/api.js @@ -12,8 +12,8 @@ export const find = ({ url }) => fetcher.get(`/find?url=${url}&sort=-score&forma export const last = ({ siteId, max }) => fetcher.get(`/last/${max}?site=${siteId}`); -export const count = ({ urls, siteId }) => fetcher.post({ - url: `/count?site=${siteId}`, +export const counts = ({ urls, siteId }) => fetcher.post({ + url: `/counts?site=${siteId}`, body: urls, }); @@ -73,7 +73,7 @@ export default { getConfig, find, last, - count, + counts, getComment, vote, send, diff --git a/web/app/counter.js b/web/app/counter.js index c3006883..bd81c8dd 100644 --- a/web/app/counter.js +++ b/web/app/counter.js @@ -33,7 +33,7 @@ function init() { return acc; }, {}); - api.count({ urls: Object.keys(map), siteId: remark_config.site_id }) + api.counts({ urls: Object.keys(map), siteId: remark_config.site_id }) .then(res => { res.forEach(item => (map[item.url].innerHTML = item.count)); });