diff --git a/src/Managing.WebApp/src/services/platformService.ts b/src/Managing.WebApp/src/services/platformService.ts
index 77e754f7..2bfcb62f 100644
--- a/src/Managing.WebApp/src/services/platformService.ts
+++ b/src/Managing.WebApp/src/services/platformService.ts
@@ -1,33 +1,34 @@
import {
+ type AgentSummaryViewModel,
DataClient,
type PlatformSummaryViewModel,
+ SortableFields,
type TopStrategiesByRoiViewModel,
- type TopStrategiesViewModel,
- type TopAgentsByPnLViewModel
+ type TopStrategiesViewModel
} from '../generated/ManagingApi'
export interface PlatformData {
platform: PlatformSummaryViewModel
topStrategies: TopStrategiesViewModel
topStrategiesByRoi: TopStrategiesByRoiViewModel
- topAgentsByPnL: TopAgentsByPnLViewModel
+ topAgentsByPnL: AgentSummaryViewModel[]
}
export const fetchPlatformData = async (apiUrl: string): Promise
=> {
const client = new DataClient({}, apiUrl)
// Fetch all platform data in parallel
- const [platform, topStrategies, topStrategiesByRoi, topAgentsByPnL] = await Promise.all([
+ const [platform, topStrategies, topStrategiesByRoi, agentIndexResponse] = await Promise.all([
client.data_GetPlatformSummary(),
client.data_GetTopStrategies(),
client.data_GetTopStrategiesByRoi(),
- client.data_GetTopAgentsByPnL()
+ client.data_GetAgentIndexPaginated(1, 3, SortableFields.NetPnL, 'desc', null) // Get top 3 agents by NetPnL
])
return {
platform,
topStrategies,
topStrategiesByRoi,
- topAgentsByPnL
+ topAgentsByPnL: agentIndexResponse.agentSummaries || []
}
}