34 lines
966 B
Ruby
34 lines
966 B
Ruby
class Admins::IdentityVerificationsController < Admins::BaseController
|
|
before_action :finder_identity_verification, except: [:index]
|
|
def index
|
|
params[:sort_by] = params[:sort_by].presence || 'created_at'
|
|
params[:sort_direction] = params[:sort_direction].presence || 'desc'
|
|
|
|
identity_verifications = Admins::IdentityVerificationQuery.call(params)
|
|
|
|
@identity_verifications = paginate identity_verifications.preload(:user)
|
|
end
|
|
|
|
def show
|
|
render 'edit'
|
|
end
|
|
def edit
|
|
end
|
|
|
|
def update
|
|
@identity_verification.update(update_params)
|
|
flash[:success] = '保存成功'
|
|
render 'edit'
|
|
end
|
|
|
|
private
|
|
def finder_identity_verification
|
|
@identity_verification = IdentityVerification.find(params[:id])
|
|
@user = @identity_verification.user
|
|
end
|
|
|
|
def update_params
|
|
params.require(:identity_verification).permit(:state, :description)
|
|
end
|
|
end
|