add: org valid

This commit is contained in:
2021-04-19 12:07:12 +08:00
committed by jasder
parent 5a9f29c25f
commit a3c49b3d5f
5 changed files with 22 additions and 2 deletions

View File

@@ -33,7 +33,10 @@ class Organizations::TeamsController < Organizations::BaseController
end
def create
@team = Organizations::Teams::CreateService.call(current_user, @organization, team_params)
ActiveRecord::Base.transaction do
Organizations::CreateTeamForm.new(team_params).validate!
@team = Organizations::Teams::CreateService.call(current_user, @organization, team_params)
end
rescue Exception => e
uid_logger_error(e.message)
tip_exception(e.message)