Fixed a bug where it was possible to add a team multiple times to a list/namespace
This commit is contained in:
parent
9638f36788
commit
26c2ad078f
5 changed files with 43 additions and 1 deletions
|
|
@ -53,6 +53,10 @@ func (c *WebHandler) CreateWeb(ctx echo.Context) error {
|
|||
return echo.NewHTTPError(http.StatusBadRequest, "The team name cannot be empty.")
|
||||
}
|
||||
|
||||
if models.IsErrTeamAlreadyHasAccess(err) {
|
||||
return echo.NewHTTPError(http.StatusBadRequest, "This team already has access.")
|
||||
}
|
||||
|
||||
return echo.NewHTTPError(http.StatusInternalServerError)
|
||||
}
|
||||
|
||||
|
|
|
|||
Reference in a new issue