|
|
|
@ -31,6 +31,9 @@ def delete(id):
|
|
|
|
# print(request.args.get('_method'))
|
|
|
|
# print(request.args.get('_method'))
|
|
|
|
# TODO: deal with deleting item that has children
|
|
|
|
# TODO: deal with deleting item that has children
|
|
|
|
cursor.execute('DELETE FROM items WHERE id=%s LIMIT 1', [id])
|
|
|
|
cursor.execute('DELETE FROM items WHERE id=%s LIMIT 1', [id])
|
|
|
|
|
|
|
|
if 'parent_id' in request.form:
|
|
|
|
|
|
|
|
return redirect('/'+request.form['parent_id'])
|
|
|
|
|
|
|
|
else:
|
|
|
|
return redirect('/')
|
|
|
|
return redirect('/')
|
|
|
|
|
|
|
|
|
|
|
|
@app.get("/<id>")
|
|
|
|
@app.get("/<id>")
|
|
|
|
|