Fixed a bug where it was possible to add the same user multiple times to a team
This commit is contained in:
parent
9c451daf30
commit
80e9021ba6
3 changed files with 26 additions and 0 deletions
|
|
@ -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)
|
||||
}
|
||||
|
|
|
|||
Reference in a new issue