Merged in feature/simplifystatus (pull request #86)

Simplify Statuses

* simple
This commit is contained in:
Michael McGuinness
2025-03-04 16:44:18 +00:00
parent a07037b018
commit 1232ed528f
7 changed files with 60 additions and 80 deletions
+4 -4
View File
@@ -13,12 +13,12 @@ import (
func (s *Controllers) ListQueries(ctx echo.Context) error {
queries, err := s.svc.Query.List(ctx.Request().Context())
if err != nil {
return echo.NewHTTPError(http.StatusNotFound, fmt.Sprintf("Unable to list query: %s", err))
return echo.NewHTTPError(http.StatusBadRequest, fmt.Sprintf("Unable to list query: %s", err))
}
outQueries, err := parseQueries(queries)
if err != nil {
return echo.NewHTTPError(http.StatusNotFound, fmt.Sprintf("Unable to list query: %s", err))
return echo.NewHTTPError(http.StatusBadRequest, fmt.Sprintf("Unable to list query: %s", err))
}
return ctx.JSON(http.StatusOK, ListQueries{
@@ -29,12 +29,12 @@ func (s *Controllers) ListQueries(ctx echo.Context) error {
func (s *Controllers) GetQuery(ctx echo.Context, id types.UUID) error {
query, err := s.svc.Query.Get(ctx.Request().Context(), id)
if err != nil {
return echo.NewHTTPError(http.StatusNotFound, fmt.Sprintf("Unable to get query: %s", err))
return echo.NewHTTPError(http.StatusBadRequest, fmt.Sprintf("Unable to get query: %s", err))
}
qt, err := parseQuery(query)
if err != nil {
return echo.NewHTTPError(http.StatusNotFound, fmt.Sprintf("Unable to get query: %s", err))
return echo.NewHTTPError(http.StatusBadRequest, fmt.Sprintf("Unable to get query: %s", err))
}
return ctx.JSON(http.StatusOK, qt)