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

* fix: lowercase slug

* fix: make fallback blocking
This commit is contained in:
Nafees Nazik 2023-01-21 21:43:55 +05:30 committed by GitHub
parent 1a19261b8f
commit da0ea5d9d0
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

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 };