1
0

Fixed a bug where it was possible to add the same user multiple times to a team

This commit is contained in:
kolaente
2018-07-26 10:06:41 +02:00
parent 9c451daf30
commit 80e9021ba6
3 changed files with 26 additions and 0 deletions

View File

@ -56,6 +56,9 @@ func (c *WebHandler) CreateWeb(ctx echo.Context) error {
if models.IsErrTeamAlreadyHasAccess(err) {
return echo.NewHTTPError(http.StatusBadRequest, "This team already has access.")
}
if models.IsErrUserIsMemberOfTeam(err) {
return echo.NewHTTPError(http.StatusBadRequest, "This user is already a member of that team.")
}
return echo.NewHTTPError(http.StatusInternalServerError)
}