fix(ui): replace raw AxiosError dumps with QueryErrorState across routes
This commit is contained in:
@@ -1,6 +1,6 @@
|
||||
import { useEffect, useMemo, useState } from 'react'
|
||||
import { useTranslation } from 'react-i18next'
|
||||
import { Alert, Badge, Button, LoadingBlock, Modal, TextInput } from '@/ui'
|
||||
import { Alert, Badge, Button, LoadingBlock, Modal, QueryErrorState, TextInput } from '@/ui'
|
||||
import { WarningIcon, XCircleIcon } from '@phosphor-icons/react'
|
||||
import { useCascadePreview } from '@/api/queries'
|
||||
import { useCascadeCloseRecord } from '@/api/mutations'
|
||||
@@ -116,9 +116,7 @@ export const CascadeConfirmDialog = ({
|
||||
{preview.isLoading && <LoadingBlock size="md" label={t('loading')} />}
|
||||
|
||||
{preview.error && (
|
||||
<Alert variant="error" title={t('error.failed')}>
|
||||
{String(preview.error)}
|
||||
</Alert>
|
||||
<QueryErrorState error={preview.error} onRetry={() => preview.refetch()} />
|
||||
)}
|
||||
|
||||
{plan && (
|
||||
@@ -261,9 +259,9 @@ export const CascadeConfirmDialog = ({
|
||||
)}
|
||||
|
||||
{cascadeMut.error && (
|
||||
<Alert variant="error" title={t('error.failed')}>
|
||||
{String(cascadeMut.error)}
|
||||
</Alert>
|
||||
/* Mutation error — no retry button (user triggers via Confirm
|
||||
again). QueryErrorState classifies 4xx/5xx code/message. */
|
||||
<QueryErrorState error={cascadeMut.error} />
|
||||
)}
|
||||
</>
|
||||
)}
|
||||
|
||||
Reference in New Issue
Block a user