From c5dbafaf90a532d3d36144bfb4f12d7303d4ca5d Mon Sep 17 00:00:00 2001 From: cjeongmin Date: Tue, 1 Oct 2024 20:56:34 +0900 Subject: [PATCH] fix: resolve issue --- src/features/trip/trip.slice.ts | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/features/trip/trip.slice.ts b/src/features/trip/trip.slice.ts index 4fad5b3..ef0408f 100644 --- a/src/features/trip/trip.slice.ts +++ b/src/features/trip/trip.slice.ts @@ -190,13 +190,13 @@ export const useTripStore = create((set, get) => ({ const newActivities = [...activities]; - items.forEach((activity, index) => { + items.forEach((activity) => { if ( newActivities[day - 1].some((act) => act.dayTime === activity.dayTime) ) return; - newActivities[day - 1].push({ ...activity, dayNumber: index + 1 }); + newActivities[day - 1].push({ ...activity, dayNumber: day }); newActivities[day - 1].sort( (a, b) => TIME_ORDER[a.dayTime] - TIME_ORDER[b.dayTime], );