Skip to content

Commit

Permalink
fix: 삭제 버튼 클릭이벤트 전파 방지 #222
Browse files Browse the repository at this point in the history
  • Loading branch information
1119wj committed Dec 3, 2024
1 parent 1e7e808 commit e3ff1f7
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions frontend/src/components/Place/DeletePlaceButton.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,8 @@ const DeletePlaceButton = ({ placeId, places }: DeletePlaceButtonProps) => {
const putPlaceToCourseMutation = usePutPlaceToCourseMutation();
const addToast = useStore((state) => state.addToast);

const onClickMapMode = () => {
const onClickMapMode = (e: React.MouseEvent<HTMLButtonElement>) => {
e.stopPropagation();
deletePlaceMutation.mutate(
{ id, placeId },
{
Expand All @@ -39,7 +40,8 @@ const DeletePlaceButton = ({ placeId, places }: DeletePlaceButtonProps) => {
[places],
);

const onClickCourseMode = () => {
const onClickCourseMode = (e: React.MouseEvent<HTMLButtonElement>) => {
e.stopPropagation();
putPlaceToCourseMutation.mutate(
{ id, places: newPlaces },
{
Expand Down

0 comments on commit e3ff1f7

Please sign in to comment.