From f290f0dbf03ea4caa9f25da69b0e8252ffe074b6 Mon Sep 17 00:00:00 2001 From: bcjang Date: Thu, 3 Apr 2025 15:48:55 +0900 Subject: [PATCH] =?UTF-8?q?dynamodb=20pagination=20=EC=B6=94=EA=B0=80=20?= =?UTF-8?q?=EC=9C=A0=EC=A0=80=EC=A1=B0=ED=9A=8C=20=EC=9A=B0=ED=8E=B8=20?= =?UTF-8?q?=ED=8E=98=EC=9D=B4=EC=A7=95=20=EC=B2=98=EB=A6=AC=20hook=20?= =?UTF-8?q?=EC=88=98=EC=A0=95?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/apis/Users.js | 4 +- src/assets/data/index.js | 7 +- src/assets/data/options.js | 5 + src/components/DataManage/UserDefaultInfo.js | 16 +- src/components/DataManage/UserMailInfo.js | 158 ++++++++++-------- .../ServiceManage/modal/BattleEventModal.js | 2 +- .../ServiceManage/modal/LandAuctionModal.js | 2 +- .../ServiceManage/modal/OwnerChangeModal.js | 12 +- .../common/Pagination/DynamoPagination.js | 56 +++++++ src/components/common/index.js | 4 +- src/{utils => hooks}/hook.js | 73 ++++++++ src/hooks/hooks.js | 1 - src/pages/DataManage/BusinessLogView.js | 2 +- src/pages/DataManage/LandInfoView.js | 2 +- src/pages/ServiceManage/BattleEvent.js | 2 +- src/pages/ServiceManage/LandAuction.js | 2 +- src/pages/ServiceManage/MailRegist.js | 2 +- src/pages/UserManage/CaliumRequest.js | 2 +- src/pages/UserManage/DataInitView.js | 2 +- 19 files changed, 266 insertions(+), 88 deletions(-) create mode 100644 src/components/common/Pagination/DynamoPagination.js rename src/{utils => hooks}/hook.js (74%) delete mode 100644 src/hooks/hooks.js diff --git a/src/apis/Users.js b/src/apis/Users.js index 213c24a..39a11fc 100644 --- a/src/apis/Users.js +++ b/src/apis/Users.js @@ -201,9 +201,9 @@ export const UserFriendListView = async (token, guid) => { }; // 우편 조회 -export const UserMailView = async (token, guid, option) => { +export const UserMailView = async (token, params) => { try { - const res = await Axios.get(`/api/v1/users/mail?guid=${guid}&type=${option}`, { + const res = await Axios.post(`/api/v1/users/mail`, params, { headers: { Authorization: `Bearer ${token}` }, }); diff --git a/src/assets/data/index.js b/src/assets/data/index.js index 201cbe5..a9433ca 100644 --- a/src/assets/data/index.js +++ b/src/assets/data/index.js @@ -21,6 +21,11 @@ export { languageType, opLandCategoryType, opLandOwnedType, - opSuccessType + opSuccessType, + opPickupType, + opReadType, + opYNType, + opUserSessionType, + opMailType, } from './options' export {benItems, MinuteList, HourList, caliumRequestInitData, STATUS_STYLES, months} from './data' \ No newline at end of file diff --git a/src/assets/data/options.js b/src/assets/data/options.js index 00b9c10..017f8fd 100644 --- a/src/assets/data/options.js +++ b/src/assets/data/options.js @@ -267,6 +267,11 @@ export const opPickupType = [ { value: false, name: '미수령' }, ]; +export const opMailType = [ + { value: 'RECEIVE', name: '받은 우편' }, + { value: 'SEND', name: '보낸 우편' }, +]; + // export const logAction = [ // { value: "None", name: "ALL" }, // { value: "AIChatDeleteCharacter", name: "NPC 삭제" }, diff --git a/src/components/DataManage/UserDefaultInfo.js b/src/components/DataManage/UserDefaultInfo.js index 34c79ae..fe6ff8b 100644 --- a/src/components/DataManage/UserDefaultInfo.js +++ b/src/components/DataManage/UserDefaultInfo.js @@ -18,7 +18,7 @@ import { TableSkeleton } from '../Skeleton/TableSkeleton'; import { UserInfoSkeleton } from '../Skeleton/UserInfoSkeleton'; import { opUserSessionType } from '../../assets/data/options'; import Button from '../common/button/Button'; -import { useModal } from '../../utils/hook'; +import { useModal } from '../../hooks/hook'; import { InitData } from '../../apis/Data'; const UserDefaultInfo = ({ userInfo }) => { @@ -38,6 +38,11 @@ const UserDefaultInfo = ({ userInfo }) => { const [dataList, setDataList] = useState({}); const [adminLevel, setAdminLevel] = useState('0'); const [loading, setLoading] = useState(true); + const [authDelete, setAuthDelete] = useState(false); + + useEffect(() => { + setAuthDelete(authInfo?.auth_list?.some(auth => auth.id === authType.userSearchDelete)); + }, [authInfo]); useEffect(() => { fetchData(); @@ -126,8 +131,13 @@ const UserDefaultInfo = ({ userInfo }) => { 접속상태 {dataList.user_session !== undefined && opUserSessionType.find(session => session.value === dataList.user_session)?.name} - {