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() {