diff --git a/web/app/common/api.js b/web/app/common/api.js index 0b357cab..4ad2defa 100644 --- a/web/app/common/api.js +++ b/web/app/common/api.js @@ -1,10 +1,15 @@ +import { siteId, url } from './settings'; + import fetcher from './fetcher' export const find = ({ url }) => fetcher.get(`/find?url=${url}&sort=time&format=tree`); -export const vote = ({ id, url, value }) => fetcher.get(`/vote/${id}?url=${url}&vote=${value}`); +export const send = ({ text }) => fetcher.post('/comment', { text, locator: { site: siteId, url } }); + +export const vote = ({ id, url, value }) => fetcher.put(`/vote/${id}?url=${url}&vote=${value}`); export default { find, + send, vote, };