From a0a941502d36c6bb29db9447b0980ed9949229a1 Mon Sep 17 00:00:00 2001 From: David Hagerty Date: Wed, 11 Feb 2026 14:54:11 -0500 Subject: [PATCH] fix(web): add readonly to ApiError.status, replace as any with specific type casts in tests --- web/src/api/client.ts | 2 +- web/src/lib/decision-graph.test.ts | 8 ++++---- 2 files changed, 5 insertions(+), 5 deletions(-) diff --git a/web/src/api/client.ts b/web/src/api/client.ts index 554cdbc..0707ac1 100644 --- a/web/src/api/client.ts +++ b/web/src/api/client.ts @@ -29,7 +29,7 @@ import type { */ export class ApiError extends Error { constructor( - public status: number, + public readonly status: number, message: string ) { super(message); diff --git a/web/src/lib/decision-graph.test.ts b/web/src/lib/decision-graph.test.ts index a109a12..17c785e 100644 --- a/web/src/lib/decision-graph.test.ts +++ b/web/src/lib/decision-graph.test.ts @@ -5,7 +5,7 @@ import { describe, it, expect } from 'vitest'; import { decisionsToElements, filterNowMode, decisionStylesheet } from './decision-graph'; -import type { GraphNode, GraphEdge } from '../types'; +import type { GraphNode, GraphEdge, NodeType, NodeStatus, EdgeType } from '../types'; /** * Create a test GraphNode. @@ -19,10 +19,10 @@ function createNode( return { id, project_id: 'proj-1', - node_type: nodeType as any, + node_type: nodeType as NodeType, title, description: 'Test description', - status: status as any, + status: status as NodeStatus, priority: 'medium', assigned_to: null, created_by: null, @@ -47,7 +47,7 @@ function createEdge( ): GraphEdge { return { id, - edge_type: edgeType as any, + edge_type: edgeType as EdgeType, from_node: fromNode, to_node: toNode, label, -- 2.51.2