更改:组织缓存信息方式改在控制器里面

This commit is contained in:
2022-09-15 09:38:28 +08:00
parent 4bd77a870b
commit 383660c778
2 changed files with 6 additions and 4 deletions

View File

@@ -31,6 +31,7 @@ class Organizations::OrganizationsController < Organizations::BaseController
Organizations::CreateForm.new(organization_params.merge(original_name: "")).validate!
@organization = Organizations::CreateService.call(current_user, organization_params)
Util.write_file(@image, avatar_path(@organization)) if params[:image].present?
Cache::V2::OwnerCommonService.new(@organization.id).reset
end
rescue Exception => e
uid_logger_error(e.message)
@@ -48,6 +49,7 @@ class Organizations::OrganizationsController < Organizations::BaseController
Gitea::Organization::UpdateService.call(current_user.gitea_token, login, @organization.reload)
Util.write_file(@image, avatar_path(@organization)) if params[:image].present?
Cache::V2::OwnerCommonService.new(@organization.id).reset
end
rescue Exception => e
uid_logger_error(e.message)