Skip to content

Commit fe4e80d

Browse files
committed
feat: 일정 수정&삭제 성공시 화면 업데이트
1 parent ed33754 commit fe4e80d

File tree

1 file changed

+14
-6
lines changed

1 file changed

+14
-6
lines changed

src/components/MyCalendar/CreateEventButton.tsx

Lines changed: 14 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -53,13 +53,21 @@ const CreateEventDialog = ({ id, title, start_date, end_date }: eventProps) => {
5353
end: endDate === '' ? startDate : endDate,
5454
};
5555
if (id) {
56-
updatePersonalSchedule(id, newEvent).catch((err) => {
57-
console.log(err);
58-
});
56+
updatePersonalSchedule(id, newEvent)
57+
.then(() => {
58+
location.href = '/';
59+
})
60+
.catch((err) => {
61+
console.log(err);
62+
});
5963
} else {
60-
addPersonalSchedule(newEvent).catch((err) => {
61-
console.log(err);
62-
});
64+
addPersonalSchedule(newEvent)
65+
.then(() => {
66+
location.href = '/';
67+
})
68+
.catch((err) => {
69+
console.log(err);
70+
});
6371
}
6472
}
6573

0 commit comments

Comments
 (0)