File tree Expand file tree Collapse file tree 1 file changed +4
-4
lines changed
.learn/exercises/08-delete-todo Expand file tree Collapse file tree 1 file changed +4
-4
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 one so 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
55The 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' ])
99def delete_todo (position ):
10- print (" This is the position to delete: " ,position)
10+ print (" This is the position to delete: " , position)
1111 return ' something'
1212```
1313
@@ -16,8 +16,8 @@ When you use the `<` and `>` symbols, Flask will return whatever the client spec
1616For example:
1717
1818``` txt
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`
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'
2121```
2222
2323## 📝 Instructions:
You can’t perform that action at this time.
0 commit comments