This commit is contained in:
@@ -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">
|
||||
|
||||
Reference in New Issue
Block a user