From 868b1f40c0c428230a98148b143f7492fd3ada35 Mon Sep 17 00:00:00 2001 From: Matt Ciaccio Date: Sat, 2 May 2026 00:30:27 +0200 Subject: [PATCH] fix(nav): drop dedicated EOI route + alerts sidebar entry, fix paginated-URL bug MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Trimmed two surfaces that didn't earn their nav weight: - The /[port]/documents/eoi route added in the previous commit was redundant with the per-interest EOI status milestones already on the interest detail and the existing eoi_queue tab inside the Documents hub. Removed the route + the "EOI queue" sidebar entry. - The Alerts sidebar entry was promoting a mostly-empty page that duplicated the dashboard alert rail. Dropped the entry; the /[port]/alerts route stays accessible via the dashboard rail's "View all" link and the topbar bell, which is enough for the audit-trail use case. While testing the EOI tab, found and fixed a real bug: usePaginatedQuery was producing malformed URLs like `…?tab=eoi_queue&signatureOnly=true?page=1&limit=25` (two `?` separators) when the endpoint string already carried query params. The API rejected those with 400, so the EOI tab in the documents hub was silently broken. The hook now uses `&` when the endpoint already contains a `?`. Co-Authored-By: Claude Opus 4.7 (1M context) --- src/app/(dashboard)/[portSlug]/documents/eoi/page.tsx | 10 ---------- src/components/layout/sidebar.tsx | 4 ---- src/hooks/use-paginated-query.ts | 8 ++++++-- 3 files changed, 6 insertions(+), 16 deletions(-) delete mode 100644 src/app/(dashboard)/[portSlug]/documents/eoi/page.tsx diff --git a/src/app/(dashboard)/[portSlug]/documents/eoi/page.tsx b/src/app/(dashboard)/[portSlug]/documents/eoi/page.tsx deleted file mode 100644 index c49e825..0000000 --- a/src/app/(dashboard)/[portSlug]/documents/eoi/page.tsx +++ /dev/null @@ -1,10 +0,0 @@ -import { DocumentsHub } from '@/components/documents/documents-hub'; - -interface PageProps { - params: Promise<{ portSlug: string }>; -} - -export default async function EoiQueuePage({ params }: PageProps) { - const { portSlug } = await params; - return ; -} diff --git a/src/components/layout/sidebar.tsx b/src/components/layout/sidebar.tsx index 694b59a..546470e 100644 --- a/src/components/layout/sidebar.tsx +++ b/src/components/layout/sidebar.tsx @@ -12,12 +12,10 @@ import { Building2, Receipt, FileText, - FileSignature, FolderOpen, Mail, Bell, Camera, - ShieldAlert, Settings, Shield, Home, @@ -69,7 +67,6 @@ function buildNavSections(portSlug: string | undefined): NavSection[] { marinaRequired: true, items: [ { href: `${base}/dashboard`, label: 'Dashboard', icon: LayoutDashboard }, - { href: `${base}/alerts`, label: 'Alerts', icon: ShieldAlert }, { href: `${base}/clients`, label: 'Clients', icon: Users }, { href: `${base}/yachts`, label: 'Yachts', icon: Ship }, { href: `${base}/companies`, label: 'Companies', icon: Building2 }, @@ -98,7 +95,6 @@ function buildNavSections(portSlug: string | undefined): NavSection[] { marinaRequired: true, items: [ { href: `${base}/documents`, label: 'Documents', icon: FileText }, - { href: `${base}/documents/eoi`, label: 'EOI queue', icon: FileSignature }, { href: `${base}/documents/files`, label: 'Files', icon: FolderOpen }, ], }, diff --git a/src/hooks/use-paginated-query.ts b/src/hooks/use-paginated-query.ts index 2b74dc5..67275d5 100644 --- a/src/hooks/use-paginated-query.ts +++ b/src/hooks/use-paginated-query.ts @@ -125,10 +125,14 @@ export function usePaginatedQuery({ const fullQueryKey = [...queryKey, apiParams]; + // Endpoints that already carry a query string (e.g. `/api/v1/documents?tab=eoi_queue`) + // need our pagination params merged with `&`, not a second `?`. Without this guard + // the URL becomes `…?tab=foo?page=1` and the API rejects it as 400. + const separator = endpoint.includes('?') ? '&' : '?'; + const { data, isLoading, isFetching } = useQuery>({ queryKey: fullQueryKey, - queryFn: () => - apiFetch>(`${endpoint}?${apiParams}`), + queryFn: () => apiFetch>(`${endpoint}${separator}${apiParams}`), }); const pagination = data?.pagination