1
0

Added an endpoint to update a team <-> namespace relation

This commit is contained in:
kolaente
2018-09-19 08:16:04 +02:00
parent aa40ab8eed
commit 067672dcb4
6 changed files with 58 additions and 1 deletions

View File

@ -24,6 +24,10 @@ func (c *WebHandler) ReadAllWeb(ctx echo.Context) error {
return echo.NewHTTPError(http.StatusForbidden, "You need to have read access to this list.")
}
if models.IsErrNamespaceDoesNotExist(err) {
return echo.NewHTTPError(http.StatusNotFound, "This namespace does not exist.")
}
return echo.NewHTTPError(http.StatusInternalServerError, "An error occured.")
}

View File

@ -119,6 +119,7 @@ func RegisterRoutes(e *echo.Echo) {
a.GET("/namespaces/:namespace/teams", namespaceTeamHandler.ReadAllWeb)
a.PUT("/namespaces/:namespace/teams", namespaceTeamHandler.CreateWeb)
a.DELETE("/namespaces/:namespace/teams/:team", namespaceTeamHandler.DeleteWeb)
a.POST("/namespaces/:namespace/teams/:team", namespaceTeamHandler.UpdateWeb)
namespaceUserHandler := &crud.WebHandler{
CObject: &models.NamespaceUser{},