Skip to content

Commit

Permalink
refactor: as를 사용하는 대신 빈 스케줄 데이터를 선언해 스케줄이 비었을 경우 사용하도록 변경
Browse files Browse the repository at this point in the history
  • Loading branch information
wzrabbit committed Nov 14, 2023
1 parent ea37ebe commit 82d2416
Showing 1 changed file with 8 additions and 1 deletion.
9 changes: 8 additions & 1 deletion frontend/src/hooks/schedule/useScheduleBarDragStatus.ts
Original file line number Diff line number Diff line change
Expand Up @@ -13,11 +13,18 @@ interface DragStatus {
initY: number;
}

const emptySchedule = {
id: 0,
title: '',
startDateTime: '2000-01-01 00:00',
endDateTime: '2000-01-01 00:10',
} as const;

export const useScheduleDragStatus = () => {
const [dragStatus, setDragStatus] = useState<DragStatus>({
isDragging: false,
level: 0,
schedule: {} as Schedule,
schedule: emptySchedule,
initX: 0,
initY: 0,
});
Expand Down

0 comments on commit 82d2416

Please sign in to comment.