( endpoint: string, annotationId: string, data: Partial<Annotation> )
| 82 | * Update an annotation on the server. |
| 83 | */ |
| 84 | export async function updateAnnotation( |
| 85 | endpoint: string, |
| 86 | annotationId: string, |
| 87 | data: Partial<Annotation> |
| 88 | ): Promise<Annotation> { |
| 89 | const response = await fetch(`${endpoint}/annotations/${annotationId}`, { |
| 90 | method: "PATCH", |
| 91 | headers: { "Content-Type": "application/json" }, |
| 92 | body: JSON.stringify(data), |
| 93 | }); |
| 94 | |
| 95 | if (!response.ok) { |
| 96 | throw new Error(`Failed to update annotation: ${response.status}`); |
| 97 | } |
| 98 | |
| 99 | return response.json(); |
| 100 | } |
| 101 | |
| 102 | /** |
| 103 | * Delete an annotation from the server. |
nothing calls this directly
no outgoing calls
no test coverage detected
searching dependent graphs…