调整用户删除检测接口

This commit is contained in:
xxq250 2024-09-25 16:21:33 +08:00
parent 9954a5f92f
commit 610db14bc9
1 changed files with 1 additions and 1 deletions

View File

@ -121,7 +121,7 @@ class Api::V1::UsersController < Api::V1::BaseController
org_ids = TeamUser.where(user_id: @observe_user.id).pluck(:organization_id) | OrganizationUser.where(user_id: @observe_user.id).pluck(:organization_id) org_ids = TeamUser.where(user_id: @observe_user.id).pluck(:organization_id) | OrganizationUser.where(user_id: @observe_user.id).pluck(:organization_id)
org_count = Organization.where(id: org_ids).count org_count = Organization.where(id: org_ids).count
project_count = Project.where(user_id: @observe_user.id).count project_count = Project.where(user_id: @observe_user.id).count
render_ok({ org_count: org_count, project_count: project_count }) render_ok({ can_delete: org_count == 0 && project_count == 0, org_count: org_count, project_count: project_count })
end end