(c echo.Context)
| 371 | } |
| 372 | |
| 373 | func (s *Server) updateSessionTitle(c echo.Context) error { |
| 374 | sessionID := c.Param("id") |
| 375 | var req api.UpdateSessionTitleRequest |
| 376 | if err := c.Bind(&req); err != nil { |
| 377 | return echo.NewHTTPError(http.StatusBadRequest, fmt.Sprintf("invalid request body: %v", err)) |
| 378 | } |
| 379 | |
| 380 | if err := s.sm.UpdateSessionTitle(c.Request().Context(), sessionID, req.Title); err != nil { |
| 381 | return echo.NewHTTPError(http.StatusInternalServerError, fmt.Sprintf("failed to update session title: %v", err)) |
| 382 | } |
| 383 | |
| 384 | return c.JSON(http.StatusOK, api.UpdateSessionTitleResponse{ |
| 385 | ID: sessionID, |
| 386 | Title: req.Title, |
| 387 | }) |
| 388 | } |
| 389 | |
| 390 | func (s *Server) deleteSession(c echo.Context) error { |
| 391 | sessionID := c.Param("id") |
nothing calls this directly
no test coverage detected