1
0

Added tests for team members

This commit is contained in:
kolaente
2018-07-27 19:20:49 +02:00
parent d556162591
commit 261136c2bc
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)
}