forked from Trustie/forgeplus
fix
This commit is contained in:
parent
50682b3668
commit
cd0aea47e0
|
|
@ -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: '进入审核队列' )
|
||||
|
|
|
|||
Loading…
Reference in New Issue