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:
2026-05-28 16:20:48 -04:00
parent 457f77eeb0
commit f436def20e

View File

@@ -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)
}