Skip to content

Commit b2dc9a5

Browse files
authored
Updated README.md
1 parent b7a0d54 commit b2dc9a5

File tree

1 file changed

+8
-6
lines changed

1 file changed

+8
-6
lines changed
Lines changed: 8 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,8 @@
11
# `08` Delete todo
22

3-
Deleting a todo is basically the opposite of adding a new todo, you should use 90% of the code from the POST /todos feature.
3+
Deleting a todo is basically the opposite of adding a new one so you should use 90% of the code from the 'POST /todos' feature.
44

5-
The main difference is that `DELETE /todos/<position:int>` will receive the position to delete in the URL of the request.
5+
The main difference is that `DELETE /todos/<position:int>` will receive the position to delete in the URL of the request like this:
66

77
```python
88
@app.route('/todos/<int:position>', methods=['DELETE'])
@@ -11,13 +11,15 @@ def delete_todo(position):
1111
return 'something'
1212
```
1313

14-
When you use the symbols `<` and `>` Flask will return whatever the client specified on that part of the URL as a variable. For example:
14+
When you use the `<` and `>` symbols, Flask will return whatever the client specified on that part of the URL as a variable.
15+
16+
For example:
1517

1618
```txt
17-
The request DELETE /todos/1 will call the function `delete_todo` with the variable position == 1
18-
The request DELETE /todos/323 will call the function `delete_todo` with the variable position == 323
19+
The request DELETE /todos/1 will call the function `delete_todo` with the variable `position == 1`
20+
The request DELETE /todos/323 will call the function `delete_todo` with the variable `position == 323`
1921
```
2022

2123
## 📝 Instructions:
2224

23-
1. Add this endpoint to your `app.py` file.
25+
1. Add this endpoint to your `app.py` file.

0 commit comments

Comments
 (0)