Merge branch 'develop' into dev_trustie_server

This commit is contained in:
jasder
2021-04-19 18:41:18 +08:00
44 changed files with 483 additions and 58 deletions

View File

@@ -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

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)
@@ -60,7 +63,7 @@ class Organizations::TeamsController < Organizations::BaseController
private
def team_params
params.permit(:name, :description, :authorize, :includes_all_project, :can_create_org_project, :unit_types => [])
params.permit(:name, :nickname, :description, :authorize, :includes_all_project, :can_create_org_project, :unit_types => [])
end
def load_organization