Fixed a bug where it was possible to add the same user multiple times to a team
This commit is contained in:
@ -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 New Issue
Block a user