fix: change is_active type from number to boolean to match API response
This commit is contained in:
parent
a75c9307d4
commit
4352732630
8 changed files with 14 additions and 14 deletions
|
|
@ -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);
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue