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:
@@ -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() {
|
||||
|
||||
Reference in New Issue
Block a user