From ddb012ec2405d273490320e8ec39a56ad9c4cca3 Mon Sep 17 00:00:00 2001 From: Eran Markus Date: Wed, 15 Apr 2026 15:40:16 +0300 Subject: [PATCH] fix: show success message on bug report submission The form showed an error even when the GitHub issue was created successfully, because onSuccess checked response.data?.state === 'open' which didn't match the actual API response shape. Now the form resets and shows success on any successful API call, with a fallback message when the issue URL isn't available in the response. Closes #1431 Co-Authored-By: Claude Opus 4.6 (1M context) --- src/pages/bugReport/BugReportForm.tsx | 19 ++++++++++--------- 1 file changed, 10 insertions(+), 9 deletions(-) diff --git a/src/pages/bugReport/BugReportForm.tsx b/src/pages/bugReport/BugReportForm.tsx index 7b86237d0..5f9e5728c 100644 --- a/src/pages/bugReport/BugReportForm.tsx +++ b/src/pages/bugReport/BugReportForm.tsx @@ -19,11 +19,8 @@ const BugReportForm = () => { const mutation = useMutation({ mutationFn: (values: CreateIssuePostRequest) => ISSUES_API.issuesCreatePost({ createIssuePostRequest: values }), - onSuccess: (response) => { - if (response.data?.state === 'open') { - form.resetFields() - // setFileList([]) - } + onSuccess: () => { + form.resetFields() }, onError: (error) => { console.error('Error submitting bug report:', error) @@ -62,11 +59,15 @@ const BugReportForm = () => {

}> {t('reportBug.description')} - {mutation.isSuccess && mutation.data?.data && ( + {mutation.isSuccess && ( - - {t('reportBug.viewIssue')} (Github) - + {mutation.data?.data?.url ? ( + + {t('reportBug.viewIssue')} (Github) + + ) : ( + t('reportBug.success', { defaultValue: 'Bug report submitted successfully!' }) + )} )}