mirror of
https://gitlink.org.cn/Gitlink/forgeplus.git
synced 2026-05-20 11:45:57 +08:00
add: org valid
This commit is contained in:
@@ -25,6 +25,7 @@ class Organizations::OrganizationsController < Organizations::BaseController
|
||||
|
||||
def create
|
||||
ActiveRecord::Base.transaction do
|
||||
Organizations::CreateForm.new(organization_params).validate!
|
||||
@organization = Organizations::CreateService.call(current_user, organization_params)
|
||||
Util.write_file(@image, avatar_path(@organization)) if params[:image].present?
|
||||
end
|
||||
|
||||
@@ -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)
|
||||
|
||||
Reference in New Issue
Block a user