diff --git a/adminfront/src/features/tenants/routes/TenantCreatePage.tsx b/adminfront/src/features/tenants/routes/TenantCreatePage.tsx
index 85efa81d..7850849d 100644
--- a/adminfront/src/features/tenants/routes/TenantCreatePage.tsx
+++ b/adminfront/src/features/tenants/routes/TenantCreatePage.tsx
@@ -59,20 +59,17 @@ function TenantCreatePage() {
{/* Tabs */}
@@ -53,7 +49,6 @@ function TenantDetailPage() {
{t("ui.admin.tenants.detail.tab_profile", "프로필")}
-
- {t("ui.admin.tenants.detail.tab_federation", "외부 연동")}
-
([]);
+ const [search, setSearch] = React.useState("");
+
const { data: profile } = useQuery({
queryKey: ["me"],
queryFn: fetchMe,
@@ -40,7 +54,6 @@ function TenantListPage() {
React.useEffect(() => {
if (profile?.role === "tenant_admin") {
const manageableCount = profile.manageableTenants?.length ?? 0;
- // If only 1 in array, OR array is empty but we have a primary tenantId
if (
(manageableCount === 1 || manageableCount === 0) &&
profile.tenantId
@@ -66,6 +79,14 @@ function TenantListPage() {
},
});
+ const deleteBulkMutation = useMutation({
+ mutationFn: (ids: string[]) => deleteTenantsBulk(ids),
+ onSuccess: () => {
+ setSelectedIds([]);
+ query.refetch();
+ },
+ });
+
if (
profile &&
profile.role !== "super_admin" &&
@@ -83,7 +104,6 @@ function TenantListPage() {
);
}
- // While redirecting (only if exactly one manageable tenant)
if (
profile?.role === "tenant_admin" &&
(profile.manageableTenants?.length ?? 0) <= 1
@@ -98,7 +118,51 @@ function TenantListPage() {
? t("msg.admin.tenants.fetch_error", "테넌트 목록 조회에 실패했습니다.")
: null;
- const tenants = query.data?.items ?? [];
+ const allTenants = query.data?.items ?? [];
+ const tenants = React.useMemo(() => {
+ if (!search.trim()) return allTenants;
+ const term = search.toLowerCase();
+ return allTenants.filter(
+ (t) =>
+ t.name.toLowerCase().includes(term) ||
+ t.slug.toLowerCase().includes(term),
+ );
+ }, [allTenants, search]);
+
+ const handleSelectAll = (checked: boolean) => {
+ if (checked) {
+ setSelectedIds(tenants.map((t) => t.id));
+ } else {
+ setSelectedIds([]);
+ }
+ };
+
+ const handleSelect = (id: string, checked: boolean) => {
+ if (checked) {
+ setSelectedIds((prev) => [...prev, id]);
+ } else {
+ setSelectedIds((prev) => prev.filter((i) => i !== id));
+ }
+ };
+
+ const handleDeleteBulk = () => {
+ if (selectedIds.length === 0) return;
+ if (
+ !window.confirm(
+ t(
+ "msg.admin.tenants.delete_bulk_confirm",
+ "선택한 {{count}}개 테넌트를 삭제할까요?",
+ { count: selectedIds.length },
+ ),
+ )
+ ) {
+ return;
+ }
+ deleteBulkMutation.mutate(selectedIds);
+ };
+
+ const rootTenant =
+ tenants.find((t) => t.type === "COMPANY_GROUP") || tenants[0];
const handleDelete = (tenantId: string, tenantName: string) => {
if (
@@ -130,6 +194,34 @@ function TenantListPage() {