Skip to content

Commit 4193190

Browse files
committed
Fix error on images page
1 parent c335aff commit 4193190

File tree

4 files changed

+4
-4
lines changed

4 files changed

+4
-4
lines changed

src/app/[categorySlug]/[recipeSlug]/[imageId]/page.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@ export default async function Page({ params }: Props) {
1717

1818
const galleryImage = await prisma.recipeGalleryImage.findUnique({
1919
where: {
20-
id: parseInt(imageId),
20+
id: parseInt(imageId) ?? -1,
2121
},
2222
});
2323

src/app/page.tsx

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,8 @@ const bySlugPosition = (tag1: { slug: string }, tag2: { slug: string }) =>
1313
const upperCaseFirstLetter = (string: string) =>
1414
string.charAt(0).toUpperCase() + string.slice(1);
1515

16+
export const dynamic = "force-static";
17+
1618
export default async function Home() {
1719
const tags = await prisma.tag.findMany({ where: { slug: { in: tagSlugs } } });
1820
const recipeCount = await prisma.recipe.count();

src/app/wszystko/page.tsx

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,7 @@ import { RecipeList } from "@/components/recipe-list/recipe-list";
44

55
interface Props {}
66

7+
export const dynamic = "force-static";
78
export default async function Page({}: Props) {
89
const recipes = await prisma.recipe.findMany({
910
include: {

src/middleware.ts

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -21,16 +21,13 @@ const getCategories = (cookieValue: string) => {
2121
};
2222

2323
export default function middleware(request: NextRequest) {
24-
console.log("Middleware executed for request:", request.url);
25-
2624
const ccCookie = request.cookies.get("cc_cookie");
2725

2826
if (!ccCookie) {
2927
return NextResponse.next();
3028
}
3129

3230
const categories = getCategories(ccCookie.value);
33-
console.log("Categories extracted from cookie:", categories);
3431

3532
if (!categories.includes("analytics")) {
3633
return NextResponse.next();

0 commit comments

Comments
 (0)