1
0

implemented team create method

This commit is contained in:
konrad
2018-07-14 17:34:59 +02:00
committed by kolaente
parent 376c649a12
commit e1c58843e9
8 changed files with 108 additions and 22 deletions

View File

@ -4,10 +4,14 @@ import (
"git.kolaente.de/konrad/list/models"
"github.com/labstack/echo"
"net/http"
"fmt"
)
// CreateWeb is the handler to create an object
func (c *WebHandler) CreateWeb(ctx echo.Context) error {
// Re-initialize our model
c.CObject.Empty()
// Get the object
if err := ctx.Bind(&c.CObject); err != nil {
return echo.NewHTTPError(http.StatusBadRequest, "No or invalid model provided.")
@ -53,6 +57,8 @@ func (c *WebHandler) CreateWeb(ctx echo.Context) error {
return echo.NewHTTPError(http.StatusNotFound, "The namespace name cannot be empty.")
}
fmt.Println(err)
return echo.NewHTTPError(http.StatusInternalServerError)
}