From 1077c383e45252b25f29e47088a9adb07a38d6ec Mon Sep 17 00:00:00 2001 From: jennyjoo <100cllr@gmail.com> Date: Wed, 3 Jul 2024 10:44:34 +0900 Subject: [PATCH 1/2] =?UTF-8?q?feat:=20=EB=8C=80=ED=91=9C=20=EA=B3=84?= =?UTF-8?q?=EC=A2=8C=20=EC=A0=95=EB=B3=B4=20=EC=A1=B0=ED=9A=8C=20api?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/api/apiClient.ts | 10 ++++++++++ src/api/interfaces/employeeApi.ts | 2 ++ src/types/api/employee-api.d.ts | 7 +++++++ 3 files changed, 19 insertions(+) diff --git a/src/api/apiClient.ts b/src/api/apiClient.ts index c65f2e5..da84de5 100644 --- a/src/api/apiClient.ts +++ b/src/api/apiClient.ts @@ -146,6 +146,16 @@ class ApiClient implements employeeApi { return response.data; } + //알바생 - 대표 계좌 조회 + public async employeeGetMyInfo(): Promise { + const response: BaseResponse = await this.axiosInstance.request({ + method: 'get', + url: 'employee/accounts', + }); + + return response.data; + } + //========================== // 생성 메소드 private static createAxiosInstance() { diff --git a/src/api/interfaces/employeeApi.ts b/src/api/interfaces/employeeApi.ts index acba320..642b98a 100644 --- a/src/api/interfaces/employeeApi.ts +++ b/src/api/interfaces/employeeApi.ts @@ -27,6 +27,8 @@ interface employeeApi { employeeSignature(payStubId: number): Promise; employeeGetAttendanceList(): Promise; + + employeeGetMyInfo(): Promise; } export default employeeApi; diff --git a/src/types/api/employee-api.d.ts b/src/types/api/employee-api.d.ts index 4187ba5..4d47c91 100644 --- a/src/types/api/employee-api.d.ts +++ b/src/types/api/employee-api.d.ts @@ -150,3 +150,10 @@ type EmployeeTodayAttendancesResponse = { works: AttendanceTodayWork[]; totalWorks: AttendanceWork[]; }; + +//대표 계좌 조회 (내 정보 조회) +type MyInfo = { + accountNumber: string; + phoneNumber: string; //전화번호 + username: string; //성명 +}; From 924066b9394430fa58d806fe16bf9cebbea4c29e Mon Sep 17 00:00:00 2001 From: jennyjoo <100cllr@gmail.com> Date: Wed, 3 Jul 2024 10:45:02 +0900 Subject: [PATCH 2/2] =?UTF-8?q?[style]:=20=EC=95=8C=EB=B0=94=EC=83=9D=20?= =?UTF-8?q?=EB=A7=88=EC=9D=B4=ED=8E=98=EC=9D=B4=EC=A7=80=EC=97=90=20?= =?UTF-8?q?=ED=95=98=EB=93=9C=EC=BD=94=EB=94=A9=20=EC=97=86=EC=95=A0?= =?UTF-8?q?=EA=B8=B0(=EB=82=B4=20=EC=A0=95=EB=B3=B4=20=EA=B4=80=EB=A0=A8)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/pages/employee/MyPageTab/MyPage.tsx | 21 ++++++++++++++++----- 1 file changed, 16 insertions(+), 5 deletions(-) diff --git a/src/pages/employee/MyPageTab/MyPage.tsx b/src/pages/employee/MyPageTab/MyPage.tsx index 91a13ad..ed45536 100644 --- a/src/pages/employee/MyPageTab/MyPage.tsx +++ b/src/pages/employee/MyPageTab/MyPage.tsx @@ -3,11 +3,9 @@ import Frame from '../../../components/Frame'; import Wrapper from '../../../components/Wrapper'; import WhiteBox from '../../../components/ui/WhiteBox'; import WorkPlaceName from '../../../components/ui/WorkPlaceName'; -import ToolBar2 from '../../../components/ui/ToolBar2'; import { useEffect, useState } from 'react'; import ApiClient from '../../../api/apiClient'; import ModalBottom from '../../../components/ModalBottom'; -import { formatDate, styleDate } from '../../../utils/format-date'; import ToolBarLink from '../../../components/ui/ToolBarLink'; import { EmployeeMenuList } from '../datas'; @@ -17,6 +15,7 @@ const MyPage = () => { const [paperDetail, setPaperDetail] = useState(null); const [isModalOpen, setModalOpen] = useState(false); + const [myInfo, setMyInfo] = useState(null); const [modalMsg, setModalMsg] = useState(''); const openModal = (msg?: string) => { @@ -43,6 +42,17 @@ const MyPage = () => { } }; + const getMyInfo = async () => { + try { + const response: MyInfo = + await ApiClient.getInstance().employeeGetMyInfo(); + + setMyInfo(response); + } catch (err) { + console.error(err); + } + }; + const fetchData = async () => { try { const response: EmploymentContractListGetResponse[] = @@ -57,6 +67,7 @@ const MyPage = () => { useEffect(() => { fetchData(); + getMyInfo(); }, []); return ( <> @@ -157,17 +168,17 @@ const MyPage = () => { {/* 성명 */}
성명
-
이름
+
{myInfo?.username}
{/* 전화번호 */}
전화번호
-
이름
+
{myInfo?.phoneNumber}
{/* 계좌번호 */}
계좌번호
-
이름
+
{myInfo?.accountNumber}