fix: macro tab MSW mock returns wrong response shape

The handler for /api/macro/impacts/:ticker was returning the impacts
array directly instead of { exposure_profile, impacts }. The frontend
destructures macroData.impacts which was undefined, falling back to
an empty array — so the Macro tab always showed 'No active macro impacts'
even with mock data present.
This commit is contained in:
Celes Renata
2026-04-17 07:14:50 +00:00
parent 419cf7558a
commit e53b9fc1bf
+1 -1
View File
@@ -163,7 +163,7 @@ export const handlers = [
const ev = mockMacroEvents.find((e) => e.id === params.id);
return ev ? HttpResponse.json({ ...ev, model_provider: 'ollama', model_name: 'test-model', prompt_version: 'event-v1', schema_version: '1.0.0', impacts: mockMacroImpacts }) : new HttpResponse(null, { status: 404 });
}),
http.get('/api/macro/impacts/:ticker', () => HttpResponse.json(mockMacroImpacts)),
http.get('/api/macro/impacts/:ticker', () => HttpResponse.json({ exposure_profile: null, impacts: mockMacroImpacts })),
http.get('/api/admin/macro/status', () => HttpResponse.json({ macro_enabled: true, source: 'default' })),
http.put('/api/admin/macro/toggle', async ({ request }) => {
const body = await request.json() as Record<string, unknown>;