MCPcopy Create free account
hub / github.com/HumanSignal/label-studio / fetchAnnotation

Function fetchAnnotation

web/libs/editor/src/hooks/useAnnotationQuery.ts:31–37  ·  view source on GitHub ↗
(id: number | string)

Source from the content-addressed store, hash-verified

29 * Fetch a single annotation from the API
30 */
31export const fetchAnnotation = async (id: number | string): Promise<AnnotationData> => {
32 const response = await fetch(`/api/annotations/${id}/`);
33 if (!response.ok) {
34 throw new Error(`Failed to fetch annotation ${id}: ${response.status}`);
35 }
36 return response.json();
37};
38
39/**
40 * Hook for fetching a single annotation with TanStack Query

Callers 2

useAnnotationFunction · 0.85
useAnnotationFetcherFunction · 0.85

Calls 2

fetchFunction · 0.85
jsonMethod · 0.80

Tested by

no test coverage detected