Fix stale social media preview: revalidate next-event fetch, reject past featured events
Made-with: Cursor
This commit is contained in:
@@ -38,8 +38,10 @@ interface NextEvent {
|
||||
|
||||
async function getNextUpcomingEvent(): Promise<NextEvent | null> {
|
||||
try {
|
||||
const revalidateSeconds =
|
||||
parseInt(process.env.NEXT_EVENT_REVALIDATE_SECONDS || '3600', 10) || 3600;
|
||||
const response = await fetch(`${apiUrl}/api/events/next/upcoming`, {
|
||||
next: { tags: ['next-event'] },
|
||||
next: { tags: ['next-event'], revalidate: revalidateSeconds },
|
||||
});
|
||||
if (!response.ok) return null;
|
||||
const data = await response.json();
|
||||
|
||||
Reference in New Issue
Block a user