diff --git a/dashboard/src/pages/NewsFeed.tsx b/dashboard/src/pages/NewsFeed.tsx
index 68178ec..8fa388f 100644
--- a/dashboard/src/pages/NewsFeed.tsx
+++ b/dashboard/src/pages/NewsFeed.tsx
@@ -8,7 +8,7 @@ interface Article {
title: string;
source: string;
url: string;
- published_at: string;
+ published_at: string | null;
ticker: string;
sentiment_score: number;
confidence: number;
@@ -105,7 +105,9 @@ export default function NewsFeed() {
{article.source}
|
- {new Date(article.published_at).toLocaleString()}
+ {article.published_at
+ ? new Date(article.published_at).toLocaleString()
+ : 'Date unknown'}
{article.ticker && (
<>
diff --git a/services/api_gateway/routes/news.py b/services/api_gateway/routes/news.py
index 644bab7..57226a6 100644
--- a/services/api_gateway/routes/news.py
+++ b/services/api_gateway/routes/news.py
@@ -73,7 +73,7 @@ async def list_news(
"published_at": (
article.published_at.isoformat()
if article.published_at
- else None
+ else article.fetched_at.isoformat()
),
"fetched_at": article.fetched_at.isoformat(),
"ticker": sentiment.ticker,