add endpoint for editing comments
This commit is contained in:
@@ -10,6 +10,7 @@ export const logOut = () => fetcher.get({ url: `/auth/logout`, overriddenApiBase
|
||||
|
||||
export const getConfig = () => fetcher.get(`/config`);
|
||||
|
||||
// TODO: looks like we can you url from settings here and below
|
||||
export const find = ({ sort, url }) => fetcher.get(`/find?url=${url}&sort=${sort}&format=tree`);
|
||||
|
||||
export const last = ({ siteId, max }) => fetcher.get(`/last/${max}?site=${siteId}`);
|
||||
@@ -39,6 +40,14 @@ export const send = ({ text, pid }) => fetcher.post({
|
||||
withCredentials: true,
|
||||
});
|
||||
|
||||
export const edit = ({ text, id }) => fetcher.put({
|
||||
url: `/comment/${id}`,
|
||||
body: {
|
||||
text,
|
||||
},
|
||||
withCredentials: true,
|
||||
});
|
||||
|
||||
export const getPreview = ({ text }) => fetcher.post({
|
||||
url: '/preview',
|
||||
body: {
|
||||
@@ -92,6 +101,7 @@ export default {
|
||||
getComment,
|
||||
vote,
|
||||
send,
|
||||
edit,
|
||||
getUser,
|
||||
getPreview,
|
||||
|
||||
|
||||
Reference in New Issue
Block a user