Skip to content

Commit

Permalink
refactor: 캘린더의 events 리턴 개선
Browse files Browse the repository at this point in the history
  • Loading branch information
Kjiw0n committed Jul 18, 2024
1 parent 956d503 commit bb78d1e
Showing 1 changed file with 12 additions and 0 deletions.
12 changes: 12 additions & 0 deletions src/components/common/fullCalendar/processEvents.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,10 @@ interface EventData {
end: string;
allDay?: boolean;
classNames: string;
extendedProps: {
taskId: number;
timeBlockId: number | null;
};
}

const processEvents = (timeBlockData: TimeBlockData): EventData[] => {
Expand All @@ -19,6 +23,10 @@ const processEvents = (timeBlockData: TimeBlockData): EventData[] => {
start: timeBlock.startTime,
end: timeBlock.endTime,
classNames: 'tasks',
extendedProps: {
taskId: task.id,
timeBlockId: timeBlock.id,
},
});
});
});
Expand All @@ -32,6 +40,10 @@ const processEvents = (timeBlockData: TimeBlockData): EventData[] => {
end: schedule.endTime,
allDay: schedule.allDay,
classNames: 'schedule',
extendedProps: {
taskId: -1, // 구글 캘린더 이벤트에는 taskId가 없으므로 -1로 설정
timeBlockId: null,
},
});
});
});
Expand Down

0 comments on commit bb78d1e

Please sign in to comment.