add getComment support to api
This commit is contained in:
+11
-1
@@ -4,14 +4,24 @@ import fetcher from './fetcher'
|
||||
|
||||
export const find = ({ url }) => fetcher.get(`/find?url=${url}&sort=time&format=tree`);
|
||||
|
||||
export const getComment = ({ id }) => fetcher.get(`/id/${id}?url=${url}`);
|
||||
|
||||
export const getUser = () => fetcher.get('/user');
|
||||
|
||||
export const send = ({ text }) => fetcher.post('/comment', { text, locator: { site: siteId, url } });
|
||||
export const send = ({ text, pid }) => fetcher.post('/comment', {
|
||||
text,
|
||||
locator: {
|
||||
site: siteId,
|
||||
url
|
||||
},
|
||||
...(pid ? { pid } : {}),
|
||||
});
|
||||
|
||||
export const vote = ({ id, url, value }) => fetcher.put(`/vote/${id}?url=${url}&vote=${value}`);
|
||||
|
||||
export default {
|
||||
find,
|
||||
getComment,
|
||||
send,
|
||||
vote,
|
||||
getUser,
|
||||
|
||||
Reference in New Issue
Block a user