Merged in feature/simplifystatus (pull request #86)
Simplify Statuses * simple
This commit is contained in:
@@ -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)
|
||||
|
||||
Reference in New Issue
Block a user