1
0

Small fixes to manage namespaces

This commit is contained in:
kolaente
2018-07-03 09:09:44 +02:00
parent 064e1cd3b7
commit ac134fb16b
2 changed files with 15 additions and 12 deletions

View File

@ -5,6 +5,7 @@ import (
"github.com/labstack/echo"
"net/http"
"strconv"
"fmt"
)
func AddNamespace(c echo.Context) error {
@ -117,7 +118,7 @@ func addOrUpdateNamespace(c echo.Context) error {
if err != nil {
return c.JSON(http.StatusInternalServerError, models.Message{"An error occured."})
}
has, err := user.IsNamespaceAdmin(oldNamespace)
has, err := user.IsNamespaceAdmin(&oldNamespace)
if err != nil {
return c.JSON(http.StatusInternalServerError, models.Message{"An error occured."})
}
@ -125,6 +126,8 @@ func addOrUpdateNamespace(c echo.Context) error {
return c.JSON(http.StatusForbidden, models.Message{"You need to be namespace admin to edit a namespace."})
}
fmt.Println(namespace)
err = models.CreateOrUpdateNamespace(namespace)
if err != nil {
return c.JSON(http.StatusInternalServerError, models.Message{"An error occured."})