Skip to content

Commit 1beda3e

Browse files
refactor: regresa esto a lo original
1 parent 20aac5d commit 1beda3e

1 file changed

Lines changed: 1 addition & 5 deletions

File tree

client/src/features/tasks/components/dnd/SortableList.tsx

Lines changed: 1 addition & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -56,11 +56,7 @@ const SortableList = () => {
5656
const overIndex = previousTasks.findIndex(({ id }) => id === over.id);
5757
const newOrder = arrayMove(previousTasks, activeIndex, overIndex);
5858
queryClient.setQueryData<TaskProps[]>(['tasks', listId], newOrder);
59-
const minIndex = Math.min(activeIndex, overIndex);
60-
const maxIndex = Math.max(activeIndex, overIndex);
61-
const items = newOrder
62-
.slice(minIndex, maxIndex + 1)
63-
.map((task, i) => ({ id: task.id, position: minIndex + i }));
59+
const items = newOrder.map((task, index) => ({ id: task.id, position: index }));
6460
reorderTasks.mutate({ items, listId, previousTasks });
6561
}
6662
setActive(null);

0 commit comments

Comments
 (0)