1
0

implemented get all namespaces via interface

This commit is contained in:
konrad
2018-07-11 13:00:00 +02:00
committed by kolaente
parent 5c4fb7ed73
commit 4213f3b08c
6 changed files with 65 additions and 40 deletions

View File

@ -1,7 +1,6 @@
package v1
import (
"git.kolaente.de/konrad/list/models"
"github.com/labstack/echo"
"net/http"
)
@ -21,15 +20,18 @@ func GetAllNamespacesByCurrentUser(c echo.Context) error {
// "500":
// "$ref": "#/responses/Message"
user, err := models.GetCurrentUser(c)
if err != nil {
return c.JSON(http.StatusInternalServerError, models.Message{"Could not get the current user."})
}
return echo.NewHTTPError(http.StatusNotImplemented)
/*
namespaces, err := models.GetAllNamespacesByUserID(user.ID)
if err != nil {
return c.JSON(http.StatusInternalServerError, models.Message{"Could not get namespaces."})
}
user, err := models.GetCurrentUser(c)
if err != nil {
return c.JSON(http.StatusInternalServerError, models.Message{"Could not get the current user."})
}
return c.JSON(http.StatusOK, namespaces)
namespaces, err := models.GetAllNamespacesByUserID(user.ID)
if err != nil {
return c.JSON(http.StatusInternalServerError, models.Message{"Could not get namespaces."})
}
return c.JSON(http.StatusOK, namespaces)*/
}