(req, res, params)
| 383 | * PATCH /annotations/:id - Update an annotation. |
| 384 | */ |
| 385 | const updateAnnotationHandler: RouteHandler = async (req, res, params) => { |
| 386 | try { |
| 387 | const body = await parseBody<Partial<Annotation>>(req); |
| 388 | |
| 389 | // Check if annotation exists |
| 390 | const existing = getAnnotation(params.id); |
| 391 | if (!existing) { |
| 392 | return sendError(res, 404, "Annotation not found"); |
| 393 | } |
| 394 | |
| 395 | const annotation = updateAnnotation(params.id, body); |
| 396 | sendJson(res, 200, annotation); |
| 397 | } catch (err) { |
| 398 | sendError(res, 400, (err as Error).message); |
| 399 | } |
| 400 | }; |
| 401 | |
| 402 | /** |
| 403 | * GET /annotations/:id - Get an annotation. |
nothing calls this directly
no test coverage detected
searching dependent graphs…