From b5d8e82f64cb143eddfbdfad3f73027fa84a6e31 Mon Sep 17 00:00:00 2001 From: Michael Chihlas Date: Thu, 28 May 2026 16:21:38 -0400 Subject: [PATCH] fix(l1): handle 402 seat_limit_exceeded on invite MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Catches the structured detail from the seat-enforcement 402 and surfaces a clear toast with current/limit counts instead of a silent failure. Modal-with-upgrade-link is a v2 polish — Phase 1 just ships a toast. Co-Authored-By: Claude Opus 4.7 --- frontend/src/pages/AccountSettingsPage.tsx | 13 +++++++++++-- 1 file changed, 11 insertions(+), 2 deletions(-) diff --git a/frontend/src/pages/AccountSettingsPage.tsx b/frontend/src/pages/AccountSettingsPage.tsx index 0cf99650..ea59273c 100644 --- a/frontend/src/pages/AccountSettingsPage.tsx +++ b/frontend/src/pages/AccountSettingsPage.tsx @@ -237,8 +237,17 @@ export function AccountSettingsPage() { const invitesData = await accountsApi.getInvites() setInvites(invitesData) } catch (err) { - toast.error('Failed to send invitation') - console.error(err) + const resp = (err as any)?.response + if (resp?.status === 402 && resp?.data?.detail?.code === 'seat_limit_exceeded') { + const d = resp.data.detail + const label = d.role === 'l1_tech' ? 'L1' : 'Engineer' + toast.warning( + `${label} seats full: ${d.current}/${d.limit}. Upgrade your plan to add more.`, + ) + } else { + toast.error('Failed to send invitation') + console.error(err) + } } finally { setIsInviting(false) }