diff --git a/frontend/src/components/Layout/Sidebar.tsx b/frontend/src/components/Layout/Sidebar.tsx index 4570dda..de8ecd7 100644 --- a/frontend/src/components/Layout/Sidebar.tsx +++ b/frontend/src/components/Layout/Sidebar.tsx @@ -42,10 +42,12 @@ export function Sidebar({ onMobileClose }: SidebarProps) { const failuresBadge = isAdminOrProduction ? (failuresData?.total || 0) : 0; const briefsBadge = allBriefs.filter(b => b.status === 'submitted').length; - // Determine current org from route params or first membership - const currentOrgSlug = + // Determine current org ID from route params or first membership. + // The route param :orgSlug actually carries the organization _id (hex string), + // not the human-readable slug — the backend queries memberships by organization_id. + const currentOrgId = params.orgSlug || - (memberships.length === 1 ? memberships[0].organization_slug : null); + (memberships.length === 1 ? memberships[0].organization_id : null); const sidebarItems: SidebarItem[] = [ { @@ -160,15 +162,15 @@ export function Sidebar({ onMobileClose }: SidebarProps) { ) : (