fix: create team overflow tip

This commit is contained in:
yystopf 2022-01-14 16:09:38 +08:00
parent 25d0e784bb
commit 70d22f7c4f
1 changed files with 1 additions and 1 deletions

View File

@ -44,7 +44,7 @@ class Organizations::TeamsController < Organizations::BaseController
def create def create
ActiveRecord::Base.transaction do ActiveRecord::Base.transaction do
if @organization.teams.count >= 50 if @organization.teams.count >= 50
return render_forbidden("组织的团队数量已超过限制!") return tip_exception("组织的团队数量已超过限制!")
else else
Organizations::CreateTeamForm.new(team_params).validate! Organizations::CreateTeamForm.new(team_params).validate!
@team = Organizations::Teams::CreateService.call(current_user, @organization, team_params) @team = Organizations::Teams::CreateService.call(current_user, @organization, team_params)