Skip to content

Commit

Permalink
Update README.md
Browse files Browse the repository at this point in the history
Se modifica la "pista" para la creacion de la nueva tarea para que corrresponda con la api actual
  • Loading branch information
carmencami authored Jan 15, 2025
1 parent 5b9f34c commit 3e4fc02
Showing 1 changed file with 5 additions and 5 deletions.
10 changes: 5 additions & 5 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -38,19 +38,19 @@ There are 3 critical moments in the application timeline (a.k.a. The runtime) to

## 💡 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 create a new task on the server. Remember to first create a new user.

```js
fetch('https://playground.4geeks.com/todo/user/alesanchezr', {
method: "PUT",
body: JSON.stringify(todos),
fetch('https://playground.4geeks.com/todo/todos/alesanchezr', {
method: "POST",
body: JSON.stringify(todo),
headers: {
"Content-Type": "application/json"
}
})
.then(resp => {
console.log(resp.ok); // Will be true if the response is successful
console.log(resp.status); // The status code=200 or code=400 etc.
console.log(resp.status); // The status code=201 or code=400 etc.
console.log(resp.text()); // Will try to return the exact result as a string
return resp.json(); // (returns promise) Will try to parse the result as JSON and return a promise that you can .then for results
})
Expand Down

0 comments on commit 3e4fc02

Please sign in to comment.