maj x build
Some checks failed
Build and Push App / build (push) Failing after 22s

This commit is contained in:
2026-04-15 22:43:32 +02:00
parent 889e70bfc0
commit 93a4c1df5e
3 changed files with 48 additions and 34 deletions

View File

@@ -2,13 +2,24 @@ import React from 'react';
import Link from 'next/link';
import { ArrowRight } from 'lucide-react';
import { prisma } from '../../lib/prisma';
import { MOCK_BLOG_POSTS } from '../../lib/mockData';
export const revalidate = 3600; // Revalidate every hour
export default async function BlogPage() {
const posts = await prisma.blogPost.findMany({
orderBy: { createdAt: 'desc' }
});
let posts: any[] = [];
try {
posts = await prisma.blogPost.findMany({
orderBy: { createdAt: 'desc' }
});
} catch (error) {
console.error("Database connection failed on blog page, using mock data.");
posts = MOCK_BLOG_POSTS.map(p => ({
...p,
createdAt: new Date(p.date), // Map mock date to createdAt to satisfy frontend
}));
}
return (
<div className="max-w-7xl mx-auto px-4 sm:px-6 lg:px-8 py-12">