File tree Expand file tree Collapse file tree 1 file changed +8
-6
lines changed
.learn/exercises/08-delete-todo Expand file tree Collapse file tree 1 file changed +8
-6
lines changed Original file line number Diff line number Diff line change 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.
You can’t perform that action at this time.
0 commit comments