DeleteEval deletes an evaluation
(c *gin.Context)
| 366 | |
| 367 | // DeleteEval deletes an evaluation |
| 368 | func (h *EvalHandler) DeleteEval(c *gin.Context) { |
| 369 | ctx := c.Request.Context() |
| 370 | id := c.Param("id") |
| 371 | |
| 372 | if err := (*h.store).Delete(ctx, "evals", id); err != nil { |
| 373 | if errors.Is(err, store.ErrNotFound) { |
| 374 | c.JSON(http.StatusNotFound, gin.H{ |
| 375 | "success": false, |
| 376 | "error": gin.H{ |
| 377 | "code": "not_found", |
| 378 | "message": "Evaluation not found", |
| 379 | }, |
| 380 | }) |
| 381 | return |
| 382 | } |
| 383 | c.JSON(http.StatusInternalServerError, gin.H{ |
| 384 | "success": false, |
| 385 | "error": gin.H{ |
| 386 | "code": "internal_error", |
| 387 | "message": err.Error(), |
| 388 | }, |
| 389 | }) |
| 390 | return |
| 391 | } |
| 392 | |
| 393 | logging.Info(ctx, "eval.deleted", map[string]any{ |
| 394 | "id": id, |
| 395 | }) |
| 396 | |
| 397 | c.Status(http.StatusNoContent) |
| 398 | } |
| 399 | |
| 400 | // CreateBenchmark creates a benchmark |
| 401 | func (h *EvalHandler) CreateBenchmark(c *gin.Context) { |