add send api endpoint for posting comments

This commit is contained in:
igoradamenko
2018-01-29 00:43:07 +02:00
parent 24e51e35a6
commit 73861df6b1
+6 -1
View File
@@ -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,
};