diff --git a/frontend/components/admin/SubstituteSection.tsx b/frontend/components/admin/SubstituteSection.tsx index adae87b5..7eef75bc 100644 --- a/frontend/components/admin/SubstituteSection.tsx +++ b/frontend/components/admin/SubstituteSection.tsx @@ -78,9 +78,17 @@ export function SubstituteSection({ originalUserId, originalUserName }: Substitu // 대무자 후보 사용자 목록 로드 (다이얼로그 열릴 때 한번) const loadCandidates = useCallback(async () => { setCandidatesLoading(true); - const res = await getUserList({ status: "active", limit: 1000 }); - if (res?.success && Array.isArray(res.data?.list)) { - const filtered = (res.data.list as Record[]).filter( + const res: any = await getUserList({ status: "active", limit: 1000 }); + // user.ts 의 getUserList 는 axios response 의 data 를 반환: + // { success, data: [...], total, ... } (data 가 list 자체) + // 또는 cross-tenant mode 등에서 { data: { list: [...] } } 일 수도 있어 둘 다 지원. + const rawList: any[] = Array.isArray(res?.data) + ? res.data + : Array.isArray(res?.data?.list) + ? res.data.list + : []; + if (rawList.length > 0) { + const filtered = (rawList as Record[]).filter( (u) => u.user_id !== originalUserId && u.user_type !== "SUPER_ADMIN" &&