1
0

Small fixes to manage namespaces

This commit is contained in:
kolaente
2018-07-03 08:48:28 +02:00
parent e0244e28d7
commit 064e1cd3b7
8 changed files with 116 additions and 17 deletions

View File

@ -1,14 +1,14 @@
package v1
import (
"github.com/labstack/echo"
"strconv"
"net/http"
"git.kolaente.de/konrad/list/models"
"github.com/labstack/echo"
"net/http"
"strconv"
)
func GetListsByNamespaceID(c echo.Context) error {
// swagger:operation GET /namespaces/{namespaceID}/lists namespaces getNamespaces
// swagger:operation GET /namespaces/{namespaceID}/lists namespaces getListsByNamespace
// ---
// summary: gets all lists belonging to that namespace
// consumes:
@ -29,8 +29,6 @@ func GetListsByNamespaceID(c echo.Context) error {
// "500":
// "$ref": "#/responses/Message"
// Check if we have our ID
id := c.Param("id")
// Make int
@ -45,7 +43,7 @@ func GetListsByNamespaceID(c echo.Context) error {
if err != nil {
return c.JSON(http.StatusInternalServerError, models.Message{"An error occured."})
}
has, err := user.HasNamespaceAccess(&models.Namespace{ID:namespaceID})
has, err := user.HasNamespaceAccess(&models.Namespace{ID: namespaceID})
if err != nil {
return c.JSON(http.StatusInternalServerError, models.Message{"An error occured."})
}
@ -65,4 +63,4 @@ func GetListsByNamespaceID(c echo.Context) error {
}
return c.JSON(http.StatusOK, lists)
}
}