fix(l1): toast on intake failure in L1Dashboard
Final review flagged silent failure on intake error. Adds a toast with the backend detail message (or fallback) on catch. Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
This commit is contained in:
@@ -3,6 +3,7 @@ import { useNavigate } from 'react-router-dom'
|
||||
import { PageMeta } from '@/components/common/PageMeta'
|
||||
import { useAuthStore } from '@/store/authStore'
|
||||
import { l1Api } from '@/api/l1'
|
||||
import { toast } from '@/lib/toast'
|
||||
import { EmptyStateCard } from '@/components/l1/EmptyStateCard'
|
||||
import { ResumeInProgress } from '@/components/l1/ResumeInProgress'
|
||||
import type { QueueRow } from '@/types/l1'
|
||||
@@ -46,6 +47,11 @@ export default function L1Dashboard() {
|
||||
customer_contact: customerContact.trim() || undefined,
|
||||
})
|
||||
navigate(`/l1/walk/${response.session_id}`)
|
||||
} catch (err) {
|
||||
const detail = (err as any)?.response?.data?.detail
|
||||
const msg =
|
||||
typeof detail === 'string' ? detail : 'Failed to start walk. Try again.'
|
||||
toast.error(msg)
|
||||
} finally {
|
||||
setSubmitting(false)
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user