Potential fix, broken workflow (#3545)

pull/3568/head
Hariom Balhara 2022-07-27 14:12:09 +05:30 committed by GitHub
parent 36e1c9272f
commit c3d05e8686
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 27 additions and 0 deletions

View File

@ -1 +1,28 @@
import { GetStaticPaths, GetStaticProps } from "next";
import { z } from "zod";
export { default } from "@ee/pages/workflows/[workflow]";
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
};
};
export const getStaticPaths: GetStaticPaths = () => {
return {
paths: [],
fallback: "blocking",
};
};