change fetcher for user delete comment action

This commit is contained in:
Pavel Mineev
2021-02-21 13:32:57 -06:00
committed by Umputun
parent a38fd1fdc3
commit 111b7a86eb
+3 -3
View File
@@ -99,6 +99,9 @@ export const addComment = ({
export const updateComment = ({ text, id }: { text: string; id: Comment['id'] }): Promise<Comment> =>
apiFetcher.put(`/comment/${id}`, { url }, { text });
export const removeMyComment = (id: Comment['id']): Promise<void> =>
apiFetcher.put(`/comment/${id}`, { url }, { delete: true });
export const getPreview = (text: string): Promise<string> => apiFetcher.post('/preview', {}, { text });
export const getUser = (): Promise<User | null> => apiFetcher.get<User | null>('/user').catch(() => null);
@@ -154,9 +157,6 @@ export const removeVerifiedStatus = (id: User['id']): Promise<void> =>
export const removeComment = (id: Comment['id']): Promise<void> => adminFetcher.delete(`/comment/${id}`, { url });
export const removeMyComment = (id: Comment['id']): Promise<void> =>
adminFetcher.put(`/comment/${id}`, { url }, { delete: true });
export const blockUser = (
id: User['id'],
ttl: BlockTTL