fix: case-sensitivity in apps path (#6552)

* fix: lowercase slug

* fix: make fallback blocking
This commit is contained in:
Nafees Nazik
2023-01-21 16:13:55 +00:00
committed by GitHub
parent 1a19261b8f
commit da0ea5d9d0
+2 -2
View File
@@ -54,7 +54,7 @@ export const getStaticPaths: GetStaticPaths<{ slug: string }> = async () => {
return {
paths,
fallback: false,
fallback: "blocking",
};
};
@@ -62,7 +62,7 @@ export const getStaticProps = async (ctx: GetStaticPropsContext) => {
if (typeof ctx.params?.slug !== "string") return { notFound: true };
const app = await prisma.app.findUnique({
where: { slug: ctx.params.slug },
where: { slug: ctx.params.slug.toLowerCase() },
});
if (!app) return { notFound: true };