Skip to content

Commit

Permalink
Merge pull request #21 from Team-B1ND/hotfix/#20
Browse files Browse the repository at this point in the history
fix :: ๋‚ด ์ผ์ • ์˜ค๋ฅ˜ ํ•ด๊ฒฐ #20
  • Loading branch information
s1hyun2 authored Sep 27, 2024
2 parents 8e43c09 + f14efd0 commit 4694fbb
Show file tree
Hide file tree
Showing 4 changed files with 15 additions and 19 deletions.
4 changes: 2 additions & 2 deletions src/hooks/schedule/useCalendarSchedules.ts
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@ const useCalendarSchedules = () => {
if (classificationKeyword === "๋‚ด ์ผ์ •") {
newSchedulesData = newSchedulesData.filter(
(schedule) =>
schedule.targetGrades[0].indexOf(String(memberData?.data.classroom.grade)) > -1 ||
schedule.targetGrades[0].indexOf(String(memberData?.data.student.grade)) > -1 ||
schedule.targetGrades[0] === "์ „๊ต์ƒ",
);
}
Expand All @@ -37,7 +37,7 @@ const useCalendarSchedules = () => {
return [...prev, newHandleCalendarSchedule];
}),
);
}, [classificationKeyword, memberData?.data?.classroom?.grade, schedulesData]);
}, [classificationKeyword, memberData?.data?.student?.grade, schedulesData]);

const calendarScheduleTransform = (schedule: Schedule) => {
const scheduleColor = dataTransform.scheduleTargetTransform(
Expand Down
2 changes: 1 addition & 1 deletion src/hooks/schedule/useHomeSidebarSchedule.ts
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ const useHomeSidebarSchedule = () => {
setSchedules(
schedulesData?.data.filter(
(schedule) =>
schedule.targetGrades[0].indexOf(String(memberData?.data.classroom.grade)) > -1 ||
schedule.targetGrades[0].indexOf(String(memberData?.data.student.grade)) > -1 ||
schedule.targetGrades[0] === "์ „๊ต์ƒ",
)!,
);
Expand Down
8 changes: 5 additions & 3 deletions src/types/common/common.type.ts
Original file line number Diff line number Diff line change
@@ -1,6 +1,8 @@
export interface ClassRoom {
readonly grade: number;
export interface Student {
readonly id: number;
readonly placeId: number;
readonly name: string;
readonly room: number;
readonly grade: number;
readonly placeId: number;
readonly parentPhone: string;
}
20 changes: 7 additions & 13 deletions src/types/member/member.type.ts
Original file line number Diff line number Diff line change
@@ -1,21 +1,15 @@
import { ClassRoom } from "../common/common.type";

export interface Member {
email: string;
id: string;
readonly joinDate: string;
name: string;
profileImage: null | string;
readonly role: string;
readonly status: "ACTIVE" | "DEACTIVATED";
}
import { Student } from "../common/common.type";

export interface MyMemberResponse extends Response {
data: {
classroom: ClassRoom;
id: number;
member: Member;
name: string;
email: string;
number: number;
phone: string;
student: Student;
profileImage: null | string;
readonly role: string;
readonly status: "ACTIVE" | "DEACTIVATED";
};
}

0 comments on commit 4694fbb

Please sign in to comment.