This commit is contained in:
Timur Ercan
2023-02-14 11:12:07 +01:00
parent a43c1f7a91
commit 3d9bf1fb67
2 changed files with 14 additions and 12 deletions

View File

@ -114,21 +114,23 @@ export async function getServerSideProps(context: any) {
const { id: documentId } = context.query;
const document: PrismaDocument = await getDocument(
+documentId,
context.req,
context.res
);
try {
const document: PrismaDocument = await getDocument(
+documentId,
context.req,
context.res
);
} catch (error) {
if (!document) {
return {
notFound: true,
};
}
}
// todo optimize querys
// todo no intersection groups
if (!document) {
return {
notFound: true,
};
}
return {
props: {
document: document,