fix: change is_active type from number to boolean to match API response

This commit is contained in:
Marko Djordjevic 2026-02-17 19:59:48 +01:00
parent a75c9307d4
commit 4352732630
8 changed files with 14 additions and 14 deletions

View file

@ -46,7 +46,7 @@ type AnnotationType = {
color: string;
category: string;
icon: string | null;
is_active: number;
is_active: boolean;
};
interface SpanAnnotation {
@ -69,7 +69,7 @@ interface SpanLabelType {
display_name: string;
color: string;
hotkey: string | null;
is_active: number;
is_active: boolean;
sort_order: number;
created_at: number;
}
@ -189,7 +189,7 @@ const CandleChart = forwardRef<CandleChartHandle, CandleChartProps>(
try {
const response = await fetch('/api/annotation-types');
const data = await response.json();
setAnnotationTypes(data.filter((t: AnnotationType) => t.is_active === 1));
setAnnotationTypes(data.filter((t: AnnotationType) => t.is_active));
return data;
} catch (error) {
console.error('Failed to fetch annotation types:', error);