修复: 邮箱搜索不需要return 404

This commit is contained in:
yystopf 2022-05-24 18:09:36 +08:00
parent 8e8ec821f2
commit e36c7a4b6a
2 changed files with 5 additions and 2 deletions

View File

@ -304,7 +304,6 @@ class UsersController < ApplicationController
def email_search
return render_error('请输入email') if params[:email].blank?
@user = User.find_by(mail: params[:email])
return render_not_found unless @user.present?
end
private

View File

@ -1 +1,5 @@
json.partial! 'users/user', locals: { user: @user }
if @user.present?
json.partial! 'users/user', locals: { user: @user }
else
json.null
end