Skip to content

Commit

Permalink
Summary
Browse files Browse the repository at this point in the history
  • Loading branch information
EuJinnLucaShow committed Jan 4, 2024
1 parent 654fd85 commit eb0a7d4
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 8 deletions.
14 changes: 7 additions & 7 deletions src/components/TodoList.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ import { DragDropContext, Droppable, Draggable } from 'react-beautiful-dnd';

import TodoItem from './TodoItem';
import { selectTodo } from 'redux/selectors';
import { fetchTodos, sendTodos } from 'redux/operations';
import { fetchTodos } from 'redux/operations';
import Pagination from '../utils/Pagination';
import { toast } from 'react-toastify';

Expand Down Expand Up @@ -52,14 +52,14 @@ const TodoList = () => {

setItems(items);

const updatedTodoIds = items.map(item => item._id);
// const updatedTodoIds = items.map(item => item._id);

const updatedTodos = [...todos].sort(
(a, b) => updatedTodoIds.indexOf(a._id) - updatedTodoIds.indexOf(b._id),
);
// const updatedTodos = [...todos].sort(
// (a, b) => updatedTodoIds.indexOf(a._id) - updatedTodoIds.indexOf(b._id),
// );

const reversed = [...updatedTodos].reverse();
dispatch(sendTodos(reversed));
// const reversed = [...updatedTodos].reverse();
// dispatch(sendTodos(reversed));
};

return (
Expand Down
2 changes: 1 addition & 1 deletion src/redux/operations.js
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import axios from 'axios';
import { createAsyncThunk } from '@reduxjs/toolkit';

axios.defaults.baseURL = 'https://todo-nbbt.onrender.com/';
axios.defaults.baseURL = 'https://todo-backend-vercel-woad.vercel.app/';

export const fetchTodos = createAsyncThunk(
'todos/fetchAll',
Expand Down

0 comments on commit eb0a7d4

Please sign in to comment.