From 610db14bc9f0c6b57c4c44b22bab62b74317d8cf Mon Sep 17 00:00:00 2001 From: xxq250 Date: Wed, 25 Sep 2024 16:21:33 +0800 Subject: [PATCH] =?UTF-8?q?=E8=B0=83=E6=95=B4=E7=94=A8=E6=88=B7=E5=88=A0?= =?UTF-8?q?=E9=99=A4=E6=A3=80=E6=B5=8B=E6=8E=A5=E5=8F=A3?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- app/controllers/api/v1/users_controller.rb | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/app/controllers/api/v1/users_controller.rb b/app/controllers/api/v1/users_controller.rb index 721e8505a..e8b064e9a 100644 --- a/app/controllers/api/v1/users_controller.rb +++ b/app/controllers/api/v1/users_controller.rb @@ -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_count = Organization.where(id: org_ids).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