Skip to content

Commit

Permalink
Merge pull request #9 from dotfortun/patch-1
Browse files Browse the repository at this point in the history
Updated README to clear up projects requirements
  • Loading branch information
alesanchezr authored Apr 5, 2024
2 parents 4a25f11 + 5b4bada commit e3d12d6
Showing 1 changed file with 7 additions and 7 deletions.
14 changes: 7 additions & 7 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -29,16 +29,16 @@ https://github.com/4GeeksAcademy/react-hello
## 📝 Instructions:

- Make your to-do list sync with the backend API every time a task is added or deleted.
- Add a clean all tasks button that will delete the entire list from the server and update the empty list on the front-end.
- Add a clean all tasks button that will `DELETE` the user from the server and empty the todo list on the front-end.

There are 3 critical moments in the application timeline (a.k.a. The runtime) to focus on your integration:
- **After the list loads empty for the first time (useEffect)**: You should fetch (GET) the data from the API and update the tasks when the information finally arrives.
- **When a new task is added**: You should PUT the new list on the server.
- **When a task is deleted**: You should PUT the new list on the server.
There are 3 critical moments in the application timeline (a.k.a. The runtime) to focus on while integrating this API:
- **After the list loads empty for the first time (`useEffect`)**: You should fetch (`GET`) the data from the API and update the tasks when the information finally arrives.
- **When a new task is added**: You should `PUT` the new list on the server.
- **When a task is removed**: You should `PUT` the new list on the server.

## 💡 Hint:

Use the following fetch call to synchronize your tasks with the server every time there is a change on the list.
Use the following fetch call to synchronize your tasks with the server every time there is a change on the list:

```js
fetch('https://playground.4geeks.com/todo/user/alesanchezr', {
Expand All @@ -60,7 +60,7 @@ fetch('https://playground.4geeks.com/todo/user/alesanchezr', {
})
.catch(error => {
// Error handling
console.log(error);
console.error(error);
});
```

Expand Down

0 comments on commit e3d12d6

Please sign in to comment.