diff --git a/frontend/src/api/accounts.ts b/frontend/src/api/accounts.ts index 943d4481..3e1e3b04 100644 --- a/frontend/src/api/accounts.ts +++ b/frontend/src/api/accounts.ts @@ -25,7 +25,7 @@ export const accountsApi = { async updateMemberRole(userId: string, role: string): Promise { const response = await apiClient.patch( `/accounts/me/members/${userId}/role`, - { role } + { account_role: role } ) return response.data }, diff --git a/frontend/src/api/client.ts b/frontend/src/api/client.ts index cf57d557..540d69dc 100644 --- a/frontend/src/api/client.ts +++ b/frontend/src/api/client.ts @@ -32,13 +32,15 @@ function handleGlobalError(error: AxiosError) { return } - // Client errors (4xx) + // Rate limit + if (status === 429) { + toast.error(data?.detail || 'Too many requests — please try again shortly') + return + } + + // Client errors (4xx) — show backend detail if present if (status >= 400 && status < 500) { - const message = data?.detail || 'Invalid request' - // Only show generic messages - pages handle specific errors - if (!data?.detail) { - toast.error(message) - } + toast.error(data?.detail || 'Invalid request') return } diff --git a/frontend/src/components/layout/Sidebar.tsx b/frontend/src/components/layout/Sidebar.tsx index da359cb8..394d5e58 100644 --- a/frontend/src/components/layout/Sidebar.tsx +++ b/frontend/src/components/layout/Sidebar.tsx @@ -172,7 +172,7 @@ export function Sidebar() { - + diff --git a/frontend/src/pages/StepLibraryPage.tsx b/frontend/src/pages/StepLibraryPage.tsx new file mode 100644 index 00000000..5592c7d8 --- /dev/null +++ b/frontend/src/pages/StepLibraryPage.tsx @@ -0,0 +1,25 @@ +import { Bookmark } from 'lucide-react' + +export default function StepLibraryPage() { + return ( +
+
+
+ +

Step Library

+
+

Reusable steps for your flows — coming soon.

+
+ +
+
+ +
+

Coming Soon

+

+ The Step Library will let you create, share, and reuse common troubleshooting steps across all your flows. +

+
+
+ ) +} diff --git a/frontend/src/pages/TreeLibraryPage.tsx b/frontend/src/pages/TreeLibraryPage.tsx index 3a2c1610..28f0635b 100644 --- a/frontend/src/pages/TreeLibraryPage.tsx +++ b/frontend/src/pages/TreeLibraryPage.tsx @@ -75,7 +75,7 @@ export function TreeLibraryPage() { const lastSessionData = (() => { const raw = safeGetItem('last-session') if (!raw) return null - try { return JSON.parse(raw) as { tree_id: string; tree_name: string; client_name: string; ticket_number: string } } + try { return JSON.parse(raw) as { tree_id: string; tree_name: string; client_name: string; ticket_number: string; tree_type?: string } } catch { return null } })() @@ -450,7 +450,7 @@ export function TreeLibraryPage() { {lastSessionData && (