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

@@ -3,6 +3,7 @@ import Link from 'next/link';
import { Play, FileText, Clock, Mic } from 'lucide-react';
import { prisma } from '../../lib/prisma';
import { InterviewType } from '@prisma/client';
import { MOCK_INTERVIEWS } from '../../lib/mockData';
export const revalidate = 3600;
@@ -19,10 +20,20 @@ export default async function AfroLifePage({ searchParams }: Props) {
where.type = filter;
}
const interviews = await prisma.interview.findMany({
where,
orderBy: { createdAt: 'desc' }
});
let interviews: any[] = [];
try {
interviews = await prisma.interview.findMany({
where,
orderBy: { createdAt: 'desc' }
});
} catch (error) {
console.error("Database connection failed on Afro Life page, using mock data.");
interviews = MOCK_INTERVIEWS.filter(i => filter === 'ALL' || i.type === filter).map(i => ({
...i,
createdAt: new Date(i.date),
}));
}
return (
<div className="bg-white min-h-screen">

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">