fix: Trading Controls page field mapping for macro/competitive status

The API returns macro_enabled/competitive_enabled but the TypeScript
interfaces expected 'enabled'. The toggles always showed disabled.
Now handles both field names with fallback.
This commit is contained in:
Celes Renata
2026-04-16 01:46:13 +00:00
parent 88c9f50371
commit e652a62dbc
2 changed files with 24 additions and 16 deletions
+6 -2
View File
@@ -596,9 +596,11 @@ export function useCorporateDecisions(ticker: string | undefined) {
// ---------------------------------------------------------------------------
export interface CompetitiveStatus {
enabled: boolean;
enabled?: boolean;
competitive_enabled?: boolean;
toggled_at: string | null;
toggled_by: string | null;
source?: string;
}
export function useCompetitiveStatus() {
@@ -720,9 +722,11 @@ export function useTrendProjection(trendId: string | undefined) {
// ---------------------------------------------------------------------------
export interface MacroStatus {
enabled: boolean;
enabled?: boolean;
macro_enabled?: boolean;
toggled_at: string | null;
toggled_by: string | null;
source?: string;
}
export function useMacroStatus() {