Skip to content

Commit

Permalink
Fix: update card list
Browse files Browse the repository at this point in the history
  • Loading branch information
JSH99 committed Mar 26, 2024
1 parent ec062f6 commit a3505fb
Show file tree
Hide file tree
Showing 3 changed files with 7 additions and 2 deletions.
2 changes: 1 addition & 1 deletion src/components/Route/DayMove/DayMove.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@ function DayMove({journeysData, selectedPlaces, onClose, setIsEditMode}: DayMove
});

// FIXME: 페이지에 잔류하면서 보여지는 데이터 갱신
window.location.reload();
// window.location.reload();
onClose();
setIsEditMode(false);
};
Expand Down
5 changes: 5 additions & 0 deletions src/components/Route/DayRoute/DayRoute.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -83,6 +83,11 @@ function DayRoute({
showToast('일정이 최적화되었습니다.');
};

useEffect(() => {
console.log('실시간 카드 리스트', placeList);
setPlaceCards(placeList);
}, [placeList]);

useEffect(() => {
setEditedPlaces({journeyId: journeyId, placeCards: placeCards});
}, [journeyId, placeCards]);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ function DeletePlacesModal({isOpen, onClose, setIsEditMode, placeList}: DeletePl
await deletePlaces.mutateAsync({spaceId: Number(id), places: placeList});

// FIXME: 페이지에 잔류하면서 보여지는 데이터 갱신
window.location.reload();
// window.location.reload();
onClose();
setIsEditMode(false);
};
Expand Down

0 comments on commit a3505fb

Please sign in to comment.