Added tests for team members

This commit is contained in:
kolaente 2018-07-27 19:20:49 +02:00
parent d556162591
commit 261136c2bc
Signed by untrusted user who does not match committer: konrad
GPG key ID: F40E70337AB24C9B
8 changed files with 112 additions and 2 deletions

View file

@ -37,6 +37,10 @@ func (c *WebHandler) DeleteWeb(ctx echo.Context) error {
return echo.NewHTTPError(http.StatusNotFound, "This team does not exist.")
}
if models.IsErrCannotDeleteLastTeamMember(err) {
return echo.NewHTTPError(http.StatusBadRequest, "You cannot delete the last member of a team.")
}
return echo.NewHTTPError(http.StatusInternalServerError)
}