(id: number | string)
| 29 | * Fetch a single annotation from the API |
| 30 | */ |
| 31 | export 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 |
no test coverage detected