apply prettier formating
This commit is contained in:
committed by
Aleksey Gurianov
parent
5d1201351a
commit
2df3aa01d4
+83
-69
@@ -15,94 +15,108 @@ export const getPostComments = ({ sort, url }) => fetcher.get(`/find?url=${url}&
|
||||
|
||||
export const getLastComments = ({ siteId, max }) => fetcher.get(`/last/${max}?site=${siteId}`);
|
||||
|
||||
export const getCommentsCount = ({ urls, siteId }) => fetcher.post({
|
||||
url: `/counts?site=${siteId}`,
|
||||
body: urls,
|
||||
});
|
||||
export const getCommentsCount = ({ urls, siteId }) =>
|
||||
fetcher.post({
|
||||
url: `/counts?site=${siteId}`,
|
||||
body: urls,
|
||||
});
|
||||
|
||||
export const getComment = ({ id }) => fetcher.get(`/id/${id}?url=${url}`);
|
||||
|
||||
export const getUserComments = ({ user, limit }) => fetcher.get(`/comments?user=${user}&limit=${limit}`);
|
||||
|
||||
export const putCommentVote = ({ id, url, value }) => fetcher.put({
|
||||
url: `/vote/${id}?url=${url}&vote=${value}`,
|
||||
withCredentials: true,
|
||||
});
|
||||
export const putCommentVote = ({ id, url, value }) =>
|
||||
fetcher.put({
|
||||
url: `/vote/${id}?url=${url}&vote=${value}`,
|
||||
withCredentials: true,
|
||||
});
|
||||
|
||||
export const addComment = ({ text, pid }) => fetcher.post({
|
||||
url: '/comment',
|
||||
body: {
|
||||
text,
|
||||
locator: {
|
||||
site: siteId,
|
||||
url,
|
||||
export const addComment = ({ text, pid }) =>
|
||||
fetcher.post({
|
||||
url: '/comment',
|
||||
body: {
|
||||
text,
|
||||
locator: {
|
||||
site: siteId,
|
||||
url,
|
||||
},
|
||||
...(pid ? { pid } : {}),
|
||||
},
|
||||
...(pid ? { pid } : {}),
|
||||
},
|
||||
withCredentials: true,
|
||||
});
|
||||
withCredentials: true,
|
||||
});
|
||||
|
||||
export const updateComment = ({ text, id }) => fetcher.put({
|
||||
url: `/comment/${id}?url=${url}`,
|
||||
body: {
|
||||
text,
|
||||
},
|
||||
withCredentials: true,
|
||||
});
|
||||
export const updateComment = ({ text, id }) =>
|
||||
fetcher.put({
|
||||
url: `/comment/${id}?url=${url}`,
|
||||
body: {
|
||||
text,
|
||||
},
|
||||
withCredentials: true,
|
||||
});
|
||||
|
||||
export const getPreview = ({ text }) => fetcher.post({
|
||||
url: '/preview',
|
||||
body: {
|
||||
text,
|
||||
},
|
||||
withCredentials: true,
|
||||
});
|
||||
export const getPreview = ({ text }) =>
|
||||
fetcher.post({
|
||||
url: '/preview',
|
||||
body: {
|
||||
text,
|
||||
},
|
||||
withCredentials: true,
|
||||
});
|
||||
|
||||
export const getUser = () => fetcher.get({
|
||||
url: '/user',
|
||||
withCredentials: true
|
||||
});
|
||||
export const getUser = () =>
|
||||
fetcher.get({
|
||||
url: '/user',
|
||||
withCredentials: true,
|
||||
});
|
||||
|
||||
/* admin */
|
||||
export const pinComment = ({ id, url }) => fetcher.put({
|
||||
url: `/admin/pin/${id}?url=${url}&pin=1`,
|
||||
withCredentials: true,
|
||||
});
|
||||
export const pinComment = ({ id, url }) =>
|
||||
fetcher.put({
|
||||
url: `/admin/pin/${id}?url=${url}&pin=1`,
|
||||
withCredentials: true,
|
||||
});
|
||||
|
||||
export const unpinComment = ({ id, url }) => fetcher.put({
|
||||
url: `/admin/pin/${id}?url=${url}&pin=0`,
|
||||
withCredentials: true,
|
||||
});
|
||||
export const unpinComment = ({ id, url }) =>
|
||||
fetcher.put({
|
||||
url: `/admin/pin/${id}?url=${url}&pin=0`,
|
||||
withCredentials: true,
|
||||
});
|
||||
|
||||
export const setVerifyStatus = ({ id }) => fetcher.put({
|
||||
url: `/admin/verify/${id}?verified=1`,
|
||||
withCredentials: true,
|
||||
});
|
||||
export const setVerifyStatus = ({ id }) =>
|
||||
fetcher.put({
|
||||
url: `/admin/verify/${id}?verified=1`,
|
||||
withCredentials: true,
|
||||
});
|
||||
|
||||
export const removeVerifyStatus = ({ id }) => fetcher.put({
|
||||
url: `/admin/verify/${id}?verified=0`,
|
||||
withCredentials: true,
|
||||
});
|
||||
export const removeVerifyStatus = ({ id }) =>
|
||||
fetcher.put({
|
||||
url: `/admin/verify/${id}?verified=0`,
|
||||
withCredentials: true,
|
||||
});
|
||||
|
||||
export const removeComment = ({ id }) => fetcher.delete({
|
||||
url: `/admin/comment/${id}?url=${url}`,
|
||||
withCredentials: true,
|
||||
});
|
||||
export const removeComment = ({ id }) =>
|
||||
fetcher.delete({
|
||||
url: `/admin/comment/${id}?url=${url}`,
|
||||
withCredentials: true,
|
||||
});
|
||||
|
||||
export const blockUser = ({ id }) => fetcher.put({
|
||||
url: `/admin/user/${id}?block=1`,
|
||||
withCredentials: true,
|
||||
});
|
||||
export const blockUser = ({ id }) =>
|
||||
fetcher.put({
|
||||
url: `/admin/user/${id}?block=1`,
|
||||
withCredentials: true,
|
||||
});
|
||||
|
||||
export const unblockUser = ({ id }) => fetcher.put({
|
||||
url: `/admin/user/${id}?block=0`,
|
||||
withCredentials: true,
|
||||
});
|
||||
export const unblockUser = ({ id }) =>
|
||||
fetcher.put({
|
||||
url: `/admin/user/${id}?block=0`,
|
||||
withCredentials: true,
|
||||
});
|
||||
|
||||
export const getBlocked = () => fetcher.get({
|
||||
url: '/admin/blocked',
|
||||
withCredentials: true,
|
||||
});
|
||||
export const getBlocked = () =>
|
||||
fetcher.get({
|
||||
url: '/admin/blocked',
|
||||
withCredentials: true,
|
||||
});
|
||||
|
||||
export default {
|
||||
logOut,
|
||||
|
||||
Reference in New Issue
Block a user