Skip to content

Commit

Permalink
reworked useBugReport hook
Browse files Browse the repository at this point in the history
  • Loading branch information
vadim-ghostman committed Jan 27, 2025
1 parent 05b9ad0 commit d3c256d
Showing 1 changed file with 6 additions and 3 deletions.
9 changes: 6 additions & 3 deletions frontend/src/hooks/useBugReport.js
Original file line number Diff line number Diff line change
Expand Up @@ -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!');
Expand Down

0 comments on commit d3c256d

Please sign in to comment.