Skip to content

Commit

Permalink
Merge pull request #104 from DeveloperRyou/hotfix
Browse files Browse the repository at this point in the history
HOTFIX: 탈퇴한 회원 버그 수정
  • Loading branch information
DeveloperRyou authored Jul 16, 2024
2 parents e26056a + acb8067 commit f9d9e9d
Show file tree
Hide file tree
Showing 9 changed files with 19 additions and 13 deletions.
10 changes: 5 additions & 5 deletions src/apis/_type.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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 };
Expand Down
4 changes: 2 additions & 2 deletions src/apis/history.ts
Original file line number Diff line number Diff line change
Expand Up @@ -19,8 +19,8 @@ interface History extends PostHistoryBody {
relation: {
position: string;
member: {
name: string;
phone: string;
name: string | null;
phone: string | null;
};
};
}
Expand Down
3 changes: 2 additions & 1 deletion src/pages/manage/attendance.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -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,
Expand All @@ -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,
Expand Down
1 change: 1 addition & 0 deletions src/pages/mypage/authority.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -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" },
Expand Down
2 changes: 1 addition & 1 deletion src/screen/manage/AddWorkModal.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@ export default function AddWorkModal() {

useEffect(() => {
const tempList = relationList?.map(
relationInfo => relationInfo.member.name,
relationInfo => relationInfo.member.name ?? "탈퇴한 회원",
);
setMemberNameList(tempList ?? []);
}, [relationList]);
Expand Down
2 changes: 1 addition & 1 deletion src/screen/manage/StaffInform.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -49,7 +49,7 @@ export default function StaffInform() {
<ProfileDiscription
name={relate.member.name}
position={relate.position}
phone={relate.member.phone}
phone={relate.member.phone ?? ""}
/>
</RouterWrapper>
))}
Expand Down
5 changes: 3 additions & 2 deletions src/screen/mypage/RelationSlider.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -30,8 +30,9 @@ export default function RelationSlider({
focus={relation.member.id === currentMemberId}
/>
<div className="w-full text-center B5-medium text-Gray5">
{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 ? "..." : ""}`}
</div>
</FlexBox>
</button>
Expand Down
4 changes: 3 additions & 1 deletion src/screen/mypage/authority/AdminAdd.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,9 @@ export default function AdminAdd({
};
return (
<FlexBox className="justify-between w-full rounded-lg border border-Gray3 px-4 py-3">
<div className="text-Gray5 B4-medium">{relation.member.name}</div>
<div className="text-Gray5 B4-medium">
{relation.member.name ?? "탈퇴한 회원"}
</div>
<Checkbox
type="round"
checked={checkedEmployees.some(
Expand Down
1 change: 1 addition & 0 deletions src/screen/mypage/authority/AdminInfoCard.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@ function AdminRemoveWapper({
}: AdminInfoCardProps & { children: React.ReactNode }) {
const { mutate: postRelationAdminMutate } = usePostRelationAdmin();
const removeAdmin = () => {
if (!relation.member.id) return;
postRelationAdminMutate({
memberId: relation.member.id,
body: { ...relation, role: "STAFF" },
Expand Down

0 comments on commit f9d9e9d

Please sign in to comment.