사용자 삭제 기능 추가
- 헤더 오른쪽 버튼 시스템 구현 - ContextType에 setOnRightClick 추가 - useSetOnRightClick 훅 추가 - HeaderNavigationProps에 onRightClick 추가 - HeaderType.LeftArrow에 오른쪽 삭제 버튼 렌더링 - 사용자 삭제 API 및 타입 추가 - UserDeleteParams, UserDeleteResponse 인터페이스 추가 - use-user-delete-mutation 훅 생성 - API_URL_USER.deleteUser() 엔드포인트 사용 - 사용자 설정 페이지에서 삭제 기능 구현 - 현재 로그인한 사용자가 아닐 경우에만 삭제 버튼 표시 - showConfirm 다이얼로그로 삭제 확인 - 삭제 성공 시 토스트 메시지 표시 및 목록 페이지로 이동 - 목록 페이지에서 refresh 상태로 자동 갱신 - showConfirm 위젯 추가 - Promise 기반의 확인 다이얼로그 - 취소/확인 버튼 지원 - 다국어 지원 (common.cancel, common.confirm) 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude <noreply@anthropic.com>
This commit is contained in:
@@ -1,5 +1,6 @@
|
||||
import { ChangeEvent, useEffect, useState } from 'react';
|
||||
import { useTranslation } from 'react-i18next';
|
||||
import { useLocation } from 'react-router-dom';
|
||||
import { PATHS } from '@/shared/constants/paths';
|
||||
import { useNavigate } from '@/shared/lib/hooks/use-navigate';
|
||||
import { DEFAULT_PAGE_PARAM } from '@/entities/common/model/constant';
|
||||
@@ -13,13 +14,14 @@ import { snackBar } from '@/shared/lib';
|
||||
|
||||
export const UserManageWrap = () => {
|
||||
const { t } = useTranslation();
|
||||
const location = useLocation();
|
||||
const { navigate } = useNavigate();
|
||||
const midOptionsWithoutGids = useStore.getState().UserStore.selectOptionsMidsWithoutGids;
|
||||
const userMid = useStore.getState().UserStore.mid;
|
||||
let midItem = midOptionsWithoutGids.filter((value, index) => {
|
||||
return value.value === userMid;
|
||||
});
|
||||
|
||||
|
||||
const [mid, setMid] = useState<string>((midItem.length > 0)? userMid: '');
|
||||
const [userItems, setUserItems] = useState<Array<UserListItem>>([]);
|
||||
const [pageParam, setPageParam] = useState(DEFAULT_PAGE_PARAM);
|
||||
@@ -56,7 +58,7 @@ export const UserManageWrap = () => {
|
||||
if(!!mid){
|
||||
callList();
|
||||
}
|
||||
}, [mid]);
|
||||
}, [mid, location.state?.refresh]);
|
||||
|
||||
return (
|
||||
<>
|
||||
|
||||
Reference in New Issue
Block a user