From 111b7a86eb52cd66b20847a167f39be46db67475 Mon Sep 17 00:00:00 2001 From: Pavel Mineev Date: Sun, 21 Feb 2021 22:26:30 +0300 Subject: [PATCH] change fetcher for user delete comment action --- frontend/app/common/api.ts | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/frontend/app/common/api.ts b/frontend/app/common/api.ts index 77347dff..c4d61208 100644 --- a/frontend/app/common/api.ts +++ b/frontend/app/common/api.ts @@ -99,6 +99,9 @@ export const addComment = ({ export const updateComment = ({ text, id }: { text: string; id: Comment['id'] }): Promise => apiFetcher.put(`/comment/${id}`, { url }, { text }); +export const removeMyComment = (id: Comment['id']): Promise => + apiFetcher.put(`/comment/${id}`, { url }, { delete: true }); + export const getPreview = (text: string): Promise => apiFetcher.post('/preview', {}, { text }); export const getUser = (): Promise => apiFetcher.get('/user').catch(() => null); @@ -154,9 +157,6 @@ export const removeVerifiedStatus = (id: User['id']): Promise => export const removeComment = (id: Comment['id']): Promise => adminFetcher.delete(`/comment/${id}`, { url }); -export const removeMyComment = (id: Comment['id']): Promise => - adminFetcher.put(`/comment/${id}`, { url }, { delete: true }); - export const blockUser = ( id: User['id'], ttl: BlockTTL