diff --git a/apps/web/src/app/(private)/_data-access/index.ts b/apps/web/src/app/(private)/_data-access/index.ts index 2b2683cfb..16002385a 100644 --- a/apps/web/src/app/(private)/_data-access/index.ts +++ b/apps/web/src/app/(private)/_data-access/index.ts @@ -9,6 +9,7 @@ import { ProjectsRepository, } from '@latitude-data/core' import { getCurrentUser } from '$/services/auth/getCurrentUser' +import { notFound } from 'next/navigation' export const getFirstProject = cache( async ({ workspaceId }: { workspaceId: number }) => { @@ -60,7 +61,7 @@ export const getDocumentByUuid = cache( if (result.error) { const error = result.error if (error instanceof NotFoundError) { - return null + return notFound() } throw error diff --git a/apps/web/src/app/(private)/projects/[projectId]/versions/[commitUuid]/documents/[documentUuid]/page.tsx b/apps/web/src/app/(private)/projects/[projectId]/versions/[commitUuid]/documents/[documentUuid]/page.tsx index 2904e1044..0b228508d 100644 --- a/apps/web/src/app/(private)/projects/[projectId]/versions/[commitUuid]/documents/[documentUuid]/page.tsx +++ b/apps/web/src/app/(private)/projects/[projectId]/versions/[commitUuid]/documents/[documentUuid]/page.tsx @@ -4,7 +4,6 @@ import { getDocumentByUuid, } from '$/app/(private)/_data-access' import { getCurrentUser } from '$/services/auth/getCurrentUser' -import { notFound } from 'next/navigation' import DocumentsLayout from '../../_components/DocumentsLayout' import ClientDocumentEditor from './_components/DocumentEditor' @@ -27,8 +26,6 @@ export default async function DocumentPage({ commit, }) - if (!document) return notFound() - return (