We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 6670ead commit 44fd8feCopy full SHA for 44fd8fe
web/cloudflare/functions/projects/[slug].ts
@@ -41,6 +41,14 @@ export const onRequest: PagesFunction<Env> = async (context) => {
41
42
// @TODO-ZM: use fetchV2
43
const projectResponse = await fetch(`${apiUrl}/Projects/${projectId}/name`);
44
+
45
+ if (!projectResponse.ok) {
46
+ return new Response(notFoundEn, {
47
+ headers: { "content-type": "text/html; charset=utf-8" },
48
+ status: 404,
49
+ });
50
+ }
51
52
const projectData = await projectResponse.json();
53
// @ts-expect-error @TODO-ZM: import @dzcode.io/api
54
const pageTitle = `${localize("project-title-pre")} ${projectData.project.name} ${localize("project-title-post")}`;
0 commit comments