implemented namespace creation via interface method

This commit is contained in:
konrad 2018-07-12 00:09:16 +02:00 committed by kolaente
parent 4734a0a6a6
commit 0aa84e653f
Signed by untrusted user who does not match committer: konrad
GPG key ID: F40E70337AB24C9B
5 changed files with 44 additions and 3 deletions

View file

@ -44,6 +44,13 @@ func (c *WebHandler) CreateWeb(ctx echo.Context) error {
return echo.NewHTTPError(http.StatusForbidden, "You need to have write access on that list.")
}
if models.IsErrNamespaceDoesNotExist(err) {
return echo.NewHTTPError(http.StatusBadRequest, "The namespace does not exist.")
}
if models.IsErrNamespaceNameCannotBeEmpty(err) {
return echo.NewHTTPError(http.StatusNotFound, "The namespace name cannot be empty.")
}
return echo.NewHTTPError(http.StatusInternalServerError)
}