From d21c119068d8f5a8a70f6d7475e8d369417a0dde Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?R=C3=A9mi=20Bonnet?= Date: Mon, 12 Aug 2024 09:19:33 +0200 Subject: [PATCH] fix(not-found-page): redirect link and status (#1561) --- .../feature/not-found-page/not-found-page.tsx | 16 +++++++++++++--- 1 file changed, 13 insertions(+), 3 deletions(-) diff --git a/libs/pages/layout/src/lib/feature/not-found-page/not-found-page.tsx b/libs/pages/layout/src/lib/feature/not-found-page/not-found-page.tsx index ff347d81887..23939cb021f 100644 --- a/libs/pages/layout/src/lib/feature/not-found-page/not-found-page.tsx +++ b/libs/pages/layout/src/lib/feature/not-found-page/not-found-page.tsx @@ -1,7 +1,12 @@ +import { useOrganizations } from '@qovery/domains/organizations/feature' +import { ORGANIZATION_URL, USER_URL } from '@qovery/shared/routes' import { Heading, Icon, Link, Section } from '@qovery/shared/ui' +import { type SerializedError } from '@qovery/shared/utils' export function NotFoundPage({ error }: { error?: unknown }) { - const errorTyped = error as Error + const errorTyped = error as SerializedError + + const { data: organizations = [] } = useOrganizations() return (
@@ -12,10 +17,15 @@ export function NotFoundPage({ error }: { error?: unknown }) { alt="Event placeholder" />
- {errorTyped?.name ?? '404'} + {errorTyped?.name ?? errorTyped?.code}

{errorTyped?.message ?? 'Not found'}

- + 0 ? ORGANIZATION_URL(organizations[0].id) : USER_URL} + size="md" + className="flex gap-2" + > Go to correct URL