fix: news articles showing 1970 dates when published_at is null
Some checks failed
ci/woodpecker/push/woodpecker Pipeline failed

Backend falls back to fetched_at when published_at is NULL in the database,
so the API always returns a meaningful date. Frontend also handles null
defensively to avoid new Date(null) producing Unix epoch 0.
This commit is contained in:
Viktor Barzin 2026-02-23 22:48:16 +00:00
parent 9f86aaf540
commit 4df7c67c13
No known key found for this signature in database
GPG key ID: 0EB088298288D958
2 changed files with 5 additions and 3 deletions

View file

@ -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,