add preview support
This commit is contained in:
+12
-1
@@ -2,6 +2,8 @@ import { siteId, url } from './settings';
|
||||
|
||||
import fetcher from './fetcher'
|
||||
|
||||
// TODO: rename actions
|
||||
|
||||
/* common */
|
||||
|
||||
export const logOut = () => fetcher.get({ url: `/auth/logout`, overriddenApiBase: '' });
|
||||
@@ -30,13 +32,21 @@ export const send = ({ text, pid }) => fetcher.post({
|
||||
text,
|
||||
locator: {
|
||||
site: siteId,
|
||||
url
|
||||
url,
|
||||
},
|
||||
...(pid ? { pid } : {}),
|
||||
},
|
||||
withCredentials: true,
|
||||
});
|
||||
|
||||
export const getPreview = ({ text }) => fetcher.post({
|
||||
url: '/preview',
|
||||
body: {
|
||||
text,
|
||||
},
|
||||
withCredentials: true,
|
||||
});
|
||||
|
||||
export const getUser = () => fetcher.get({
|
||||
url: '/user',
|
||||
withCredentials: true
|
||||
@@ -83,6 +93,7 @@ export default {
|
||||
vote,
|
||||
send,
|
||||
getUser,
|
||||
getPreview,
|
||||
|
||||
pin,
|
||||
unpin,
|
||||
|
||||
Reference in New Issue
Block a user