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
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:
@ -93,14 +93,36 @@ export default function RadarPage() {
|
|||||||
checkAuth()
|
checkAuth()
|
||||||
}, [checkAuth])
|
}, [checkAuth])
|
||||||
|
|
||||||
// Load Data
|
// Load Data - Using same API as Market page for consistency
|
||||||
const loadDashboardData = useCallback(async () => {
|
const loadDashboardData = useCallback(async () => {
|
||||||
try {
|
try {
|
||||||
const summary = await api.getDashboardSummary()
|
// Use getMarketFeed for consistency with Market & Acquire pages
|
||||||
setHotAuctions((summary.market.ending_soon_preview || []).slice(0, 6))
|
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({
|
setMarketStats({
|
||||||
totalAuctions: summary.market.total_auctions || 0,
|
totalAuctions: result.auction_count || result.total || 0,
|
||||||
endingSoon: summary.market.ending_soon || 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) {
|
} catch (error) {
|
||||||
console.error('Failed to load data:', error)
|
console.error('Failed to load data:', error)
|
||||||
|
|||||||
Reference in New Issue
Block a user