This commit is contained in:
yystopf 2026-03-30 15:47:41 +08:00
parent 50682b3668
commit cd0aea47e0
1 changed files with 2 additions and 2 deletions

View File

@ -21,7 +21,7 @@ class Api::V1::ResidentExpertsController < Api::V1::BaseController
@resident_expert = ResidentExpert.new(resident_expert_params)
@resident_expert.user = current_user
if @resident_expert.save
Util.write_file(@image, avatar_path(@resident_expert)) if params[:avatar].present?
Util.write_file(@image, avatar_path(@resident_expert)) if params[:image].present?
@resident_expert.resident_expert_actions.create(action_type: ResidentExpertAction::action_types[:approved], action_name: '提交申请' )
@resident_expert.resident_expert_actions.create(action_type: ResidentExpertAction::action_types[:approved], action_name: '进入审核队列' )
@resident_expert.resident_expert_actions.create(action_type: ResidentExpertAction::action_types[:pending], action_name: '管理员审核中', action_description: "预计 13 个工作日内完成" )
@ -38,7 +38,7 @@ class Api::V1::ResidentExpertsController < Api::V1::BaseController
@resident_expert.attributes = resident_expert_params
@resident_expert.status = ResidentExpert::statuses[:pending]
if @resident_expert.save
Util.write_file(@image, avatar_path(@resident_expert)) if params[:avatar].present?
Util.write_file(@image, avatar_path(@resident_expert)) if params[:image].present?
@resident_expert.resident_expert_actions.destroy_all
@resident_expert.resident_expert_actions.create(action_type: ResidentExpertAction::action_types[:approved], action_name: '提交申请' )
@resident_expert.resident_expert_actions.create(action_type: ResidentExpertAction::action_types[:approved], action_name: '进入审核队列' )