fix: Unify Radar to use same getMarketFeed API as Market & Acquire
Some checks failed
CI / Frontend Lint & Type Check (push) Has been cancelled
CI / Frontend Build (push) Has been cancelled
CI / Backend Lint (push) Has been cancelled
CI / Backend Tests (push) Has been cancelled
CI / Docker Build (push) Has been cancelled
CI / Security Scan (push) Has been cancelled
Deploy / Build & Push Images (push) Has been cancelled
Deploy / Deploy to Server (push) Has been cancelled
Deploy / Notify (push) Has been cancelled

This commit is contained in:
2025-12-14 21:22:01 +01:00
parent 3995c2d675
commit 8051b2ac51

View File

@ -93,14 +93,36 @@ export default function RadarPage() {
checkAuth()
}, [checkAuth])
// Load Data
// Load Data - Using same API as Market page for consistency
const loadDashboardData = useCallback(async () => {
try {
const summary = await api.getDashboardSummary()
setHotAuctions((summary.market.ending_soon_preview || []).slice(0, 6))
// Use getMarketFeed for consistency with Market & Acquire pages
const result = await api.getMarketFeed({
source: 'all',
sortBy: 'time',
limit: 10, // Show top 10 ending soon
})
// Convert to HotAuction format
const auctions = (result.items || [])
.filter((item: any) => item.status === 'auction' && item.end_time)
.slice(0, 6)
.map((item: any) => ({
domain: item.domain,
current_bid: item.price || 0,
time_remaining: item.time_remaining || '',
platform: item.source || 'Unknown',
affiliate_url: item.url || '',
}))
setHotAuctions(auctions)
setMarketStats({
totalAuctions: summary.market.total_auctions || 0,
endingSoon: summary.market.ending_soon || 0,
totalAuctions: result.auction_count || result.total || 0,
endingSoon: result.items?.filter((i: any) => {
if (!i.end_time) return false
const hoursLeft = (new Date(i.end_time).getTime() - Date.now()) / (1000 * 60 * 60)
return hoursLeft > 0 && hoursLeft <= 24
}).length || 0,
})
} catch (error) {
console.error('Failed to load data:', error)