import { useMutation } from '@tanstack/react-query' import { useApiClient } from './use_api_client' export const useReportBugAction = () => { const apiClient = useApiClient() return useMutation({ mutationFn: async ({ description, description_json, attachmentIds, }: { description: string description_json: Record attachmentIds: string[] }) => { return apiClient.chat.post({ url: `/me/report_bug`, data: { data: { type: '', attributes: { description, description_json: JSON.stringify(description_json), attachment_ids: attachmentIds, }, }, }, }) }, }) }