From d06ed681258c32b31f404b92809dc0083f4d67c7 Mon Sep 17 00:00:00 2001 From: konrad Date: Wed, 18 Jul 2018 22:19:51 +0200 Subject: [PATCH] cleanup --- routes/crud/create.go | 4 ---- routes/crud/delete.go | 3 --- routes/crud/read_all.go | 4 ---- routes/crud/update.go | 3 --- 4 files changed, 14 deletions(-) diff --git a/routes/crud/create.go b/routes/crud/create.go index f8b186be..7289f727 100644 --- a/routes/crud/create.go +++ b/routes/crud/create.go @@ -1,7 +1,6 @@ package crud import ( - "fmt" "git.kolaente.de/konrad/list/models" "github.com/labstack/echo" "net/http" @@ -16,7 +15,6 @@ func (c *WebHandler) CreateWeb(ctx echo.Context) error { // Get the object & bind params to struct if err := ParamBinder(c.CObject, ctx); err != nil { - fmt.Println(err) return echo.NewHTTPError(http.StatusBadRequest, "No or invalid model provided.") } @@ -64,8 +62,6 @@ func (c *WebHandler) CreateWeb(ctx echo.Context) error { return echo.NewHTTPError(http.StatusBadRequest, "The team name cannot be empty.") } - fmt.Println(err) - return echo.NewHTTPError(http.StatusInternalServerError) } diff --git a/routes/crud/delete.go b/routes/crud/delete.go index 8990d1ef..39bc7014 100644 --- a/routes/crud/delete.go +++ b/routes/crud/delete.go @@ -4,7 +4,6 @@ import ( "git.kolaente.de/konrad/list/models" "github.com/labstack/echo" "net/http" - "fmt" ) // DeleteWeb is the web handler to delete something @@ -26,8 +25,6 @@ func (c *WebHandler) DeleteWeb(ctx echo.Context) error { err = c.CObject.Delete() if err != nil { - fmt.Println(err) - if models.IsErrNeedToBeListAdmin(err) { return echo.NewHTTPError(http.StatusForbidden, "You need to be the list admin to delete a list.") } diff --git a/routes/crud/read_all.go b/routes/crud/read_all.go index 86274036..9cd39e2e 100644 --- a/routes/crud/read_all.go +++ b/routes/crud/read_all.go @@ -1,7 +1,6 @@ package crud import ( - "fmt" "git.kolaente.de/konrad/list/models" "github.com/labstack/echo" "net/http" @@ -16,14 +15,11 @@ func (c *WebHandler) ReadAllWeb(ctx echo.Context) error { // Get the object & bind params to struct if err := ParamBinder(c.CObject, ctx); err != nil { - fmt.Println(err) return echo.NewHTTPError(http.StatusBadRequest, "No or invalid model provided.") } lists, err := c.CObject.ReadAll(¤tUser) if err != nil { - fmt.Println(err) - return echo.NewHTTPError(http.StatusInternalServerError, "An error occured.") } diff --git a/routes/crud/update.go b/routes/crud/update.go index 37e92bc4..59124fbb 100644 --- a/routes/crud/update.go +++ b/routes/crud/update.go @@ -1,7 +1,6 @@ package crud import ( - "fmt" "git.kolaente.de/konrad/list/models" "github.com/labstack/echo" "net/http" @@ -51,8 +50,6 @@ func (c *WebHandler) UpdateWeb(ctx echo.Context) error { return echo.NewHTTPError(http.StatusBadRequest, "The namespace owner cannot be empty.") } - fmt.Println(err) - return echo.NewHTTPError(http.StatusInternalServerError) }