1
0
forked from baron/baron-sso

fix: 프론트엔드 테스트 환경 런타임 오류(getSortIcon 누락) 및 타입스크립트 에러 수정

This commit is contained in:
2026-05-14 11:35:27 +09:00
parent 574238c744
commit 5cd3f04f69
2 changed files with 24 additions and 2 deletions

View File

@@ -4,7 +4,7 @@ import {
useQuery,
type UseMutationResult,
} from "@tanstack/react-query";
import type { AdminProfile } from "../../../lib/adminApi";
import type { UserProfileResponse } from "../../../lib/adminApi";
import { useVirtualizer } from "@tanstack/react-virtual";
import type { AxiosError } from "axios";
import {
@@ -498,6 +498,17 @@ function TenantListPage() {
setSortConfig((current) => toggleSort(current, key));
};
const getSortIcon = (key: TenantSortKey) => {
if (!sortConfig || sortConfig.key !== key) {
return <ArrowUpDown size={14} className="ml-1 opacity-50" />;
}
return sortConfig.direction === "asc" ? (
<ArrowUp size={14} className="ml-1" />
) : (
<ArrowDown size={14} className="ml-1" />
);
};
const deletableTenants = React.useMemo(
() => allTenants.filter((tenant) => !isSeedTenant(tenant)),
[allTenants],
@@ -1196,7 +1207,7 @@ const TenantHierarchyView: React.FC<{
{ tenantId: string; status: string },
unknown
>;
profile: AdminProfile | undefined;
profile: UserProfileResponse | undefined;
sortConfig: SortConfig<TenantSortKey> | null;
requestSort: (key: TenantSortKey) => void;
getSortIcon: (key: TenantSortKey) => React.ReactNode;

View File

@@ -303,6 +303,17 @@ function UserListPage() {
setSortConfig((current) => toggleSort(current, key));
};
const getSortIcon = (key: UserSortKey) => {
if (!sortConfig || sortConfig.key !== key) {
return <ArrowUpDown size={14} className="ml-1 opacity-50" />;
}
return sortConfig.direction === "asc" ? (
<ArrowUp size={14} className="ml-1" />
) : (
<ArrowDown size={14} className="ml-1" />
);
};
const total = query.data?.total ?? 0;
const totalPages = Math.ceil(total / limit);
const canPromoteSuperAdmin = isSuperAdminRole(profile?.role);