From acb80672534e8c556ad0cf943e676c9727862509 Mon Sep 17 00:00:00 2001 From: developerryou Date: Tue, 16 Jul 2024 17:13:41 +0900 Subject: [PATCH] =?UTF-8?q?HOTFIX:=20=ED=83=88=ED=87=B4=ED=95=9C=20?= =?UTF-8?q?=ED=9A=8C=EC=9B=90=20=EB=B2=84=EA=B7=B8=20=EC=88=98=EC=A0=95?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/apis/_type.ts | 10 +++++----- src/apis/history.ts | 4 ++-- src/pages/manage/attendance.tsx | 3 ++- src/pages/mypage/authority.tsx | 1 + src/screen/manage/AddWorkModal.tsx | 2 +- src/screen/manage/StaffInform.tsx | 2 +- src/screen/mypage/RelationSlider.tsx | 5 +++-- src/screen/mypage/authority/AdminAdd.tsx | 4 +++- src/screen/mypage/authority/AdminInfoCard.tsx | 1 + 9 files changed, 19 insertions(+), 13 deletions(-) diff --git a/src/apis/_type.ts b/src/apis/_type.ts index 3f4e1cf..1a16c9c 100644 --- a/src/apis/_type.ts +++ b/src/apis/_type.ts @@ -16,11 +16,11 @@ interface Store { } interface AbstractMember { - id: string; - name: string; - phone: string; - providerType: ProviderType; - storeList: Store[]; + id: string | null; + name: string | null; + phone: string | null; + providerType: ProviderType | null; + storeList: Store[] | null; } export type { StatusType, DayType, ProviderType, RoleType }; diff --git a/src/apis/history.ts b/src/apis/history.ts index 8305574..efcc9e6 100644 --- a/src/apis/history.ts +++ b/src/apis/history.ts @@ -19,8 +19,8 @@ interface History extends PostHistoryBody { relation: { position: string; member: { - name: string; - phone: string; + name: string | null; + phone: string | null; }; }; } diff --git a/src/pages/manage/attendance.tsx b/src/pages/manage/attendance.tsx index a357ec8..37be9b1 100644 --- a/src/pages/manage/attendance.tsx +++ b/src/pages/manage/attendance.tsx @@ -39,7 +39,7 @@ export default function Attendance() { const allButtonClick = () => { filteredList.forEach(history => { - if (history.status === "DISAPPROVED") { + if (history.status === "DISAPPROVED" && history.relation.member.id) { postHistoryStatusMutate({ memberId: history.relation.member.id, historyId: history.id, @@ -51,6 +51,7 @@ export default function Attendance() { const profileClick = (index: number) => { const history = filteredList[index]; + if (!history.relation.member.id) return; postHistoryStatusMutate({ memberId: history.relation.member.id, historyId: history.id, diff --git a/src/pages/mypage/authority.tsx b/src/pages/mypage/authority.tsx index 2733371..19286c4 100644 --- a/src/pages/mypage/authority.tsx +++ b/src/pages/mypage/authority.tsx @@ -19,6 +19,7 @@ export default function MyPageAuthorithy() { const addNewAdmin = () => { checkedEmployees.forEach(item => { + if (!item?.member.id) return; postRelationAdminMutate({ memberId: item?.member.id, body: { ...item, role: "MANAGER" }, diff --git a/src/screen/manage/AddWorkModal.tsx b/src/screen/manage/AddWorkModal.tsx index 20bd70d..0848fbf 100644 --- a/src/screen/manage/AddWorkModal.tsx +++ b/src/screen/manage/AddWorkModal.tsx @@ -35,7 +35,7 @@ export default function AddWorkModal() { useEffect(() => { const tempList = relationList?.map( - relationInfo => relationInfo.member.name, + relationInfo => relationInfo.member.name ?? "탈퇴한 회원", ); setMemberNameList(tempList ?? []); }, [relationList]); diff --git a/src/screen/manage/StaffInform.tsx b/src/screen/manage/StaffInform.tsx index 8dd0888..7a4160b 100644 --- a/src/screen/manage/StaffInform.tsx +++ b/src/screen/manage/StaffInform.tsx @@ -49,7 +49,7 @@ export default function StaffInform() { ))} diff --git a/src/screen/mypage/RelationSlider.tsx b/src/screen/mypage/RelationSlider.tsx index c88a820..a34cf5c 100644 --- a/src/screen/mypage/RelationSlider.tsx +++ b/src/screen/mypage/RelationSlider.tsx @@ -30,8 +30,9 @@ export default function RelationSlider({ focus={relation.member.id === currentMemberId} />
- {relation.member.name.slice(0, 5)} - {relation.member.name.length > 5 && "..."} + {relation.member.name === null + ? "탈퇴한 회원" + : `${relation.member.name?.slice(0, 5)}${relation.member.name && relation.member.name.length > 5 ? "..." : ""}`}
diff --git a/src/screen/mypage/authority/AdminAdd.tsx b/src/screen/mypage/authority/AdminAdd.tsx index 4d4e807..50a5f40 100644 --- a/src/screen/mypage/authority/AdminAdd.tsx +++ b/src/screen/mypage/authority/AdminAdd.tsx @@ -24,7 +24,9 @@ export default function AdminAdd({ }; return ( -
{relation.member.name}
+
+ {relation.member.name ?? "탈퇴한 회원"} +
{ + if (!relation.member.id) return; postRelationAdminMutate({ memberId: relation.member.id, body: { ...relation, role: "STAFF" },