fix: Move future/workflow/[workflow] getStaticProps into separate file (#16124)

This commit is contained in:
Joe Au-Yeung
2024-08-28 08:53:32 -04:00
committed by GitHub
parent 356ecfe2fa
commit 6b244fc5b5
2 changed files with 22 additions and 1 deletions
@@ -0,0 +1,19 @@
import type { GetStaticProps } from "next";
import { z } from "zod";
const querySchema = z.object({
workflow: z.string(),
});
export const getStaticProps: GetStaticProps = (ctx) => {
const params = querySchema.safeParse(ctx.params);
console.log("Built workflow page:", params);
if (!params.success) return { notFound: true };
return {
props: {
workflow: params.data.workflow,
},
revalidate: 10, // seconds
};
};