diff --git a/web/app/common/api.js b/web/app/common/api.js index 34d1a70c..3397b116 100644 --- a/web/app/common/api.js +++ b/web/app/common/api.js @@ -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,