diff --git a/app/controllers/api/v1/resident_experts_controller.rb b/app/controllers/api/v1/resident_experts_controller.rb index d0c8b0a03..40667d36d 100644 --- a/app/controllers/api/v1/resident_experts_controller.rb +++ b/app/controllers/api/v1/resident_experts_controller.rb @@ -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: "预计 1~3 个工作日内完成" ) @@ -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: '进入审核队列' )