From d3c256dccef55740b91c82ddd736d864385ac23f Mon Sep 17 00:00:00 2001 From: vadim-ghostman Date: Mon, 27 Jan 2025 20:59:55 +0100 Subject: [PATCH] reworked useBugReport hook --- frontend/src/hooks/useBugReport.js | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) diff --git a/frontend/src/hooks/useBugReport.js b/frontend/src/hooks/useBugReport.js index f6251efa8..70c919d84 100644 --- a/frontend/src/hooks/useBugReport.js +++ b/frontend/src/hooks/useBugReport.js @@ -2,15 +2,18 @@ import { useMutation } from '@tanstack/react-query'; import { axiosInstance } from 'utils/axios'; // import { generateTelegramLink } from 'services/telegram'; import { notify } from 'components/layout/notifier/Notifier'; +import { sendExtraDepositTransaction } from 'services/transaction'; export const useBugReport = (walletId, bugDescription, onClose) => { const mutation = useMutation({ mutationFn: async () => { - return await axiosInstance.post(`/api/save-bug-report`, { - telegram_id: window?.Telegram?.WebApp?.initData?.user?.id, + const user_id = window?.Telegram?.WebApp?.initData?.user?.id; + const data = { wallet_id: walletId, bug_description: bugDescription, - }); + } + if (user_id) data.telegram_id = user_id; + return await axiosInstance.post(`/api/save-bug-report`, data); }, onSuccess: () => { notify('Report sent successfully!');