Spaces:
Runtime error
Runtime error
Vinay Jose commited on
Update app.py
Browse files
app.py
CHANGED
|
@@ -63,12 +63,12 @@ def contacts_edit_post(contact_id=0):
|
|
| 63 |
else:
|
| 64 |
render_template("edit.html", contact=c)
|
| 65 |
|
| 66 |
-
@app.
|
| 67 |
def contacts_delete(contact_id=0):
|
| 68 |
contact = Contact.find(contact_id)
|
| 69 |
contact.delete()
|
| 70 |
flash("Deleted Contact!")
|
| 71 |
-
return redirect("/contacts")
|
| 72 |
|
| 73 |
if __name__ == "__main__":
|
| 74 |
app.run(host="0.0.0.0", port="7860", debug=True)
|
|
|
|
| 63 |
else:
|
| 64 |
render_template("edit.html", contact=c)
|
| 65 |
|
| 66 |
+
@app.delete("/contacts/<contact_id>")
|
| 67 |
def contacts_delete(contact_id=0):
|
| 68 |
contact = Contact.find(contact_id)
|
| 69 |
contact.delete()
|
| 70 |
flash("Deleted Contact!")
|
| 71 |
+
return redirect("/contacts", 303)
|
| 72 |
|
| 73 |
if __name__ == "__main__":
|
| 74 |
app.run(host="0.0.0.0", port="7860", debug=True)
|