사용자 계정 관리 기능 구현 및 API 오류 수정
- 사용자 로그인 인증정보 관리 기능 구현 (이메일/휴대폰 추가/삭제) - 사용자 추가 기능 구현 (실시간 ID 중복 검증 포함) - 사용자 목록 조회 기능 구현 - API 엔드포인트 오류 수정 (userExistsUserid: GET → POST, URL 경로 수정) - TypeScript 타입 오류 수정 (UseQueryOptions, UserCreateParams/Response) - 이메일/휴대폰 형식 검증 및 중복 방지 로직 추가 🤖 Generated with [Claude Code](https://claude.ai/code) Co-Authored-By: Claude <noreply@anthropic.com>
This commit is contained in:
@@ -2,21 +2,29 @@ import { useEffect, useState } from 'react';
|
||||
import { PATHS } from '@/shared/constants/paths';
|
||||
import { useNavigate } from '@/shared/lib/hooks/use-navigate';
|
||||
import { AuthItem } from '../model/types';
|
||||
import { DEFAULT_PAGE_PARAM } from '@/entities/common/model/constant';
|
||||
import { UserManageAuthList } from './user-manage-auth-list';
|
||||
import { useUserFindMutation } from '@/entities/user/api/use-user-find-mutation';
|
||||
import { UserListItem } from '@/entities/user/model/types';
|
||||
|
||||
export const UserManageWrap = () => {
|
||||
const { navigate } = useNavigate();
|
||||
const { mutateAsync: userFind } = useUserFindMutation();
|
||||
const [userItems, setUserItems] = useState<Array<UserListItem>>([]);
|
||||
const [pageParam, setPageParam] = useState(DEFAULT_PAGE_PARAM);
|
||||
const [mid, setMid] = useState<string>('nictest00m');
|
||||
|
||||
const [authItems, setAuthItems] = useState<Array<AuthItem>>([]);
|
||||
const midList = [
|
||||
{ value: 'nictest00m', label: 'nictest00m' },
|
||||
{ value: 'nictest01m', label: 'nictest01m' },
|
||||
{ value: 'nictest02m', label: 'nictest02m' },
|
||||
];
|
||||
|
||||
const callAuthList = () => {
|
||||
setAuthItems([
|
||||
{useYn: true, authName: 'test01', tid: 'A12334556'},
|
||||
{useYn: true, authName: 'test02', tid: 'A33334556'},
|
||||
{useYn: true, authName: 'test03', tid: 'A12345556'},
|
||||
{useYn: true, authName: 'test04', tid: 'A12978676'},
|
||||
{useYn: false, authName: 'test05', tid: 'A12344444'},
|
||||
]);
|
||||
const callList = (mid: string) => {
|
||||
setPageParam(pageParam);
|
||||
userFind({ mid: mid, page: pageParam }).then((rs) => {
|
||||
setUserItems(rs.content || []);
|
||||
});
|
||||
};
|
||||
|
||||
const onClickToNavigation = () => {
|
||||
@@ -24,21 +32,25 @@ export const UserManageWrap = () => {
|
||||
};
|
||||
|
||||
useEffect(() => {
|
||||
callAuthList();
|
||||
}, []);
|
||||
callList(mid);
|
||||
}, [mid]);
|
||||
|
||||
return (
|
||||
<>
|
||||
<div className="ing-list">
|
||||
<div className="input-wrapper top-select mt-16">
|
||||
<select>
|
||||
<option>nicetest00m</option>
|
||||
<select value={mid} onChange={e => setMid(e.target.value)}>
|
||||
{midList.map(item => (
|
||||
<option key={item.value} value={item.value}>{item.label}</option>
|
||||
))}
|
||||
</select>
|
||||
</div>
|
||||
|
||||
<div className="ing-title">등록 현황</div>
|
||||
{ (!!authItems && authItems.length > 0) &&
|
||||
{ (!!userItems && userItems.length > 0) &&
|
||||
<UserManageAuthList
|
||||
authItems={ authItems }
|
||||
userItems={ userItems }
|
||||
mid={ mid }
|
||||
></UserManageAuthList>
|
||||
}
|
||||
<div className="apply-row bottom-padding">
|
||||
|
||||
Reference in New Issue
Block a user